Spotfire® User Guide

Creating a violin plot

You can add a kernel density estimate (KDE) to the box plot to effectively turn it into a violin plot.

About this task

A violin plot is a visualization that combines a box plot and a KDE to show the distribution of a data set. The width of the plot at different values represents the density of the data at those points; wider areas mean more data is concentrated there. This helps you see the overall shape of the data, how spread out or clustered it is, and patterns that a box plot alone might not reveal.

Before you begin

You must have the Add and configure a violin in the box plot licence feature under the Spotfire Data Science licence, and the analysis must be in Editing mode.

You have created a box plot.

Procedure

  1. In the visualization properties panel, click and select Violin.
    By default, the bandwidth is calculated using Silverman’s rule of thumb. For more information about this method and the calculation of the KDE, see Violin plot algorithm.
  2. To change the calculation of the bandwidth, edit the expression. Click for suggestions or to open the expression editor.

    Note: When you have also applied the Histogram to the box plot, only a half-violin is shown.