Tableau doesn’t have built-in support for violin plots, only boxplots. While boxplots are more familiar, violin plots are more informative because they show you the entire distribution instead of merely quartiles. For example, take a look at the same data drawn as a boxplot (left) and a violin plot (right):
The boxplot doesn’t give any hint that these values follow a bimodal distribution, while the violin plot makes it clear.
I would be remiss not to mention the heroics that Tableau consultant Gwilym Lockwood went through to create a violin plot in Tableau. The blog post is worth a read, but the takeaway is that you’d have to really want a violin plot to go through all of those steps.
In R, on the other hand, there are several packages that provide violin plots; a cursory search turned up vioplot, plotly, ggpubr, and ggplot2. Here’s how you might create a violin plot in ggplot2, using the
mtcars data set, showing the horsepower (
hp) distribution for each cylinder count (
With shinytableau, we can wrap this R code into an easy-to-use Tableau dashboard extension that can be used by Tableau users that don’t even know what R is. They don’t need to modify the code to point to the data source and variables they want to plot, because you’re going to provide them with a GUI for that. They don’t need to think about how to configure R on their server, because you can deploy it just once for all users of the extension.
Take a look at what it’s like to use a shinytableau extension:
You (and other Tableau users) can use the same shinytableau extension across multiple dashboards. And just as a single Tableau dashboard can contain multiple (e.g.) bar chart sheets, each with its own view of the data, you can also have one shinytableau extension appear multiple times in a dashboard, with each instance configured differently.
We’ll come back to violin plots later, but let’s look at some much simpler examples first.
Next step: Writing your first extension