Questions tagged [violin-plot]

A violin plot is a method of plotting numeric data. It is a box plot with a rotated kernel density plot on each side.

A violin plot is a method of plotting numeric data. It is a box plot with a rotated kernel density plot on each side.

https://en.wikipedia.org/wiki/Violin_plot

364 questions
4
votes
2 answers

Create multiple stacked violin plots with ggplot

I have a model which runs on different landscapes, once on both together and once on each separately. I would like to plot the results in violin plots, but I'd like to have both runs side by side in the same plot, and each landscape to have its own…
Ronny Efronny
  • 1,148
  • 9
  • 28
4
votes
1 answer

Combine spaghetti plot (with a grouping variable) with split-violins (without it) in ggplot2

Here's a minimal reproducible example: library(ggplot2) mydata <- data.frame(condition = c(rep("One",40), rep("Two",40)), participant = rep(1:40,2), observation = c(rnorm(40,2,1), rnorm(40,0,1))) #my.plot…
elisa
  • 965
  • 9
  • 27
4
votes
2 answers

change x location of violin plot in ggplot2

I was trying to create a violin plot using a continuous variable factored in x. I currently have the x values of 0,3,5,8. When I plot them as a violin they show up equally spaced from each other. Is there a way to force the locations of the violins…
GBrue
  • 53
  • 1
  • 5
4
votes
1 answer

Gnuplot: Violin plot with data from file

I created a script to plot the columns of a dataset using violin plots to show the distribution of the data points starting from the Gnuplot Demo Scripts. However, I can't solve the following error: "violinplot.gnu", line 27: all points y value…
Nicola
  • 395
  • 2
  • 13
4
votes
1 answer

Seaborn box plot broken after update to 0.6.0

I have recently updated my seaborn from 0.5.1 to the new 0.6.0 version. I had been using seaborn to make box plots and violinplots in python notebookand now I can't seem to make my code work anymore. Matplotlib plt.boxplot still works with my data.…
salima
  • 43
  • 1
  • 3
3
votes
2 answers

Create a split violin plot with paired points and proper orientation

With ggplot2, I can create a violin plot with overlapping points, and paired points can be connected using geom_line(). library(datasets) library(ggplot2) library(dplyr) iris_edit <- iris %>% group_by(Species) %>% mutate(paired =…
acvill
  • 395
  • 7
  • 15
3
votes
0 answers

Adjusting the space between violin plots on the x-axis

I have violin plots with non-numerical variables on the x-axis. Some of the violin plots are very wide and some of them very narrow due to their distribution. To avoid the overlap between the plots, I narrowed the width of the plots. However this…
3
votes
1 answer

Violin plot in plotly enclosing individual data points

How can I create a violin plot that encloses individual data points? The code below displays the violin and the individual data points next to each other; however, rather than next to each other I want the violin to enclose the points (magenta…
hans
  • 323
  • 1
  • 14
3
votes
1 answer

How can I change the labels of the x-axis of a seaborn violin plot without going back and changing the data?

I have the following seaborn violin plot: sns.violinplot( x=c1_census['Cluster Labels'], y=c1_census['Land Area (km2)'],palette=my_pal) plt.show() How can I change the labels of the x-axis without going back and changing the data. For…
Efren M
  • 67
  • 5
3
votes
1 answer

To resize and make the Violin chart of PotlyJS responsive

I want the violin chart (I'm using plotlyjs library) to be responsive. But also don't want it to compress so much (it is compressing according to the div it is kept in). I have tried to turn the autosize property of violin to be false and then set…
3
votes
2 answers

Seaborn violin plot over time given numpy ndarray

I have a distribution that changes over time for which I would like to plot a violin plot for each time step side-by-side using seaborn. My initial attempt failed as violinplot cannot handle a np.ndarray for the y argument: import numpy as np import…
smonsays
  • 400
  • 2
  • 17
3
votes
1 answer

Min and max values in seaborn violinplot are invalid

I'm plotting the distribution of daily returns from stock index in a particular year using seaborn violinplot. However some extreme values on the chart looks to be plotted improperly. The chart below is an example for one year. As you can see the…
overb
  • 127
  • 2
  • 10
3
votes
0 answers

Error with labels in split violin plot in ggplot2 (R) due to missing values

I am generating split violin plots using the geom_split_violin function created here: Split violin plot with ggplot2. Then, I add labels for sample sizes (n = ...) for each split violin. However, there are some missing values, which results in…
Sylvia Rodriguez
  • 1,203
  • 2
  • 11
  • 30
3
votes
1 answer

matplotlib/seaborn violin plot with colormap

I want to create a violin plot, with either matplotlib or searborn, in which the plot is colored according to a colormap. This is what I get: This is what I would like to get (I used Photoshop here): How can I obtain the desired plot?
Nisba
  • 3,210
  • 2
  • 27
  • 46
3
votes
1 answer

How to plot the body of violin-plot on top of span rectangle?

I want to do a violin-plot on top of a background color. I use axvspan to create the background. My problem is: I can't find a way to make the body of the violin-plot (the violin shape) appears on top of background color. It is only visible through…
remi
  • 33
  • 4
1 2
3
24 25