Creating box and violin plots with Danfo.js
The box and violin plots are similar and will generally use the same parameters. So, we will cover them both in this section.
In the following examples, we will first make a box plot and then change it to a violin plot by changing only the plot type option.
Making box and violin plots for a Series
To make a box plot for a Series or a single column in a DataFrame, first, we subset to get the Series, and then we'll call the plot type on it, as demonstrated in the following code snippet:
var layout = { title: "Box plot on a Series", } var config = { layout } new_df["AAPL.Open"].plot(this_div()).box(config)
Running the preceding code cell gives the following output:
Now, in order to change the preceding plot to a violin plot, you can just change the plot type to violin
, as shown in the following snippet...