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
0
votes
1 answer

violin plots for all columns of two dataframes with each side of a violin showing the same column but from another dataframe

I have two pandas dataframes named train_df and test_df. They both have columns with same names and test_df doesn't have only one column that train_df does. I now want to plot violin plots showing distribution(like box plot) of each column of my…
Naveen Reddy Marthala
  • 2,622
  • 4
  • 35
  • 67
0
votes
1 answer

Seaborn violinplots not showing correctly

I am using Seaborn violinplot() and swarmplot() to show data from a Dataframe. Swarmplot works fine, while I am having troubles using the violinplot. I do all plots in loops and most of them show up as expected, but a few figures do not have…
Line
  • 58
  • 5
0
votes
1 answer

Combine statistical tests with rstatix and color fill per category

I use this code to do violin plots with ggplot2: Cells1 %>% ggplot(aes(x=IR_time, y=AreaShape_Area, fill=IR_time)) + geom_violin(col=NA) + guides(fill=FALSE) + stat_summary(fun.data=data_summary, col = "black") + theme_gray() + …
Pauline
  • 3
  • 1
0
votes
1 answer

Plot a group box or violin plot from two data frames in python

I have two dataframes of equal size. I would like to plot the distribution of the data on a boxplot or violin plot as a pair. Thus far I was able to plot them, however, the distributions are top of each other. How can I plot them next to each…
Lamech
  • 23
  • 2
  • 8
0
votes
1 answer

Solid color legend for split violin plot (ggplot)?

I'm trying to get the legend colors in this split violin plot to be solid. I've successfully removed the lines that were here (following a different post on this site), but I can't figure out how to proceed. ctn_sv <- ggplot(z, aes(x = time, y =…
jambo
  • 3
  • 1
0
votes
0 answers

How to create violin plots when categorical variable is numeric (and unevenly separated)

I'm trying to create a violinplot using matplotlib (but I could use seaborn, but I have almost no experience with it). My challenge is that the categorical variable I have is actually numeric, and matplotlib seems to insist on mapping the…
Joel
  • 22,598
  • 6
  • 69
  • 93
0
votes
0 answers

Can I use Annotate in ggplot2 to fill my violin graph?

I made a violin graph using rtruncnorm and a set of data and annotated it. This is my plot code: ggplot(g) + annotate(geom = "rect", xmin = -Inf , xmax = Inf , ymin = 0, ymax = 1, fill = "red", alpha= 0.4) + annotate(geom = "rect",…
0
votes
1 answer

python: multiple split violine plot overlayed

I have a set of samples to illustrate in violin plots. Here is an example by plotly. I want something similar, but multiple "blue" distributions on the left-hand side of the violin. Very likely the area under the distribution is semi-transparent…
Simon
  • 703
  • 2
  • 8
  • 19
0
votes
1 answer

Violin plot with geom_jitter dots greater than a defined value

I want to create a violin plot with geom_jitter dots greater than a defined value. Below is the picture and code I used to get this violin plot with a box plot and geom_jitter for data points. Is there a way to have geom_jitter for dots >58 and hide…
Assir
  • 11
  • 2
0
votes
1 answer

Visualize a matrix using geom_violin() in r

I have a correlation matrix (200x200) in the form of: >cormat n1 n2 n3 n1 1.000000000 0.132555050 0.009169320 n2 -0.121419322 1.000000000 -0.174995204 n3 -0.259331076 -0.171652163…
Question
  • 43
  • 7
0
votes
0 answers

Splitting a plotly violin plot by more than two groups

My question is about expanding R plotly's grouped violin plot to a case with more than two groups. Taking the data that are used in the grouped violin plot example code and adding a third level to df$sex: library(dplyr) set.seed(1) df <-…
dan
  • 6,048
  • 10
  • 57
  • 125
0
votes
1 answer

Y names in violinplot using loops

I am trying to get a pdf with multiple violinplots using a loop. I manage to create the plots but I did not find how to change the Y axis names or the title according the column name. My xlab will be the only "conidtion" for all the plots but Ylab…
0
votes
2 answers

Problem in aligning a violin plot along with boxplot inside

I have a melted dataframe df with first column sample names, second column Group, third column Genes, fourth column Expression (logCPM). head(df) sample names Group Genes Expression (logCPM) Sample1 GroupA Gene1 3.45 Sample2 …
beginner
  • 1,059
  • 8
  • 23
0
votes
1 answer

Violin plot: one violin, two halves by Boolean value

I am toying around with seaborn violinplot, trying to make a single "violin" with each half being a different distribution, to be easily compared. Modifying the simple example from here by changing the x axis to x=smoker I got to the following graph…
MonoColorado
  • 29
  • 1
  • 1
  • 7
0
votes
1 answer

Seaborn Catplot Violin plotting age distribution in negative integer

I am trying to plot age distribution regarding survived, sex, class variables. from matplotlib import pyplot import seaborn titanic= seaborn.load_dataset("titanic") g = seaborn.catplot(data = titanic, x = 'survived', y = 'age', …
Dohun
  • 477
  • 2
  • 7
  • 13