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

How to plot split violinplot or group boxplot with seaborn

My data format is like this: +--------+----------+----------+----------+----------+----------+----------+ | method | Feature1 | Feature2 | Feature3 | Feature4 | Feature5 | Feature6…
Ranglage
  • 9
  • 3
0
votes
1 answer

How to split observations into two groups based on a condition for geom.violin?

I have a dataframe that I'd like to plot in a violin plot, where the observations are binned into one of two groups: [va_AC == 1] or [va_AC > 1]. Is there a way to do this without adding a new column to df to assign it a group? ggplot(df) + …
Carmen Sandoval
  • 2,266
  • 5
  • 30
  • 46
0
votes
1 answer

How to give color to specific points in violin plot in R

I created a violin plot in R, and I want to change part of the dots color and size. This change will be according to an attribute of True/False in the data file. This is how I tried it: p <- ggplot(data, aes(order,count),levels=data_levels)…
0
votes
1 answer

Plot all categories in boxplot or violinplot

I have a matplotlib figure with a few violinplots on it (although this question would apply to any similar plot or other dataframe situation, not just violinplots). I currently run my code and it spits out the figure, with one violinplot per…
Emily Beth
  • 709
  • 1
  • 7
  • 23
0
votes
0 answers

Violin-plot and boxplot median are not overlapping in same dataset using ggplot2 - where is my mistake?

The dataset I used can be downloaded here: https://dropfile.to/aEWZ5U2. I wanted to make a violin plot with a boxplot in it. I used the following code with the dataset: for (c in c('age','educ','hours')){ print(ggplot(data, aes_string(y=c))+ …
Jaynes01
  • 521
  • 1
  • 5
  • 20
0
votes
1 answer

R violin plot (vioplot) does not display data of same value

I am trying to create a violin plot of results of a survey, and everything looks fine, expect for those cases where all respondents submitted the same answer. In these cases, vioplot displays nothing, and I changed from vioplot to boxplot to have at…
Tom
  • 319
  • 1
  • 3
  • 11
0
votes
1 answer

Seaborn Overfitting Violin Plots

I am wanting to use a violin plot to compare a distribtuion of scores from two different dates. The scores are a percentage, yet for some reason the plot results in values greater than 1 and less than 0 despite the fact that all scores lie between…
meb
  • 11
0
votes
2 answers

Violin plot not working as expected

I am trying to generate a violin plot for a given dataset. The data varies from 0 to 100. But the violin plot goes over 100 and goes below 0. How can I limit it between 0 to 100? Code Used: library(ggplot2) input_data <-…
John Rambo
  • 906
  • 1
  • 17
  • 37
0
votes
1 answer

Inner boxplots in seaborn violinplots not accurate

The inner boxplots that I get (through specification of inner='box') when generating seaborn violinplots are not accurate for my actual data. See example plot below. The actual data extend to the tip of the thin tails. But the boxplots end well…
Emily Beth
  • 709
  • 1
  • 7
  • 23
0
votes
1 answer

add a subplot for the whole sample without duplicating the data

Does ggplot allow to add a subplot without using the grouping variable to show the whole sample as in the figure. # example df b<-abs(round(rnorm(500, sd=30))) y<-runif(5) pr<-y/sum(y) names<-unlist(lapply(mapply(rep, LETTERS[1:5], 1:5), function…
Ferroao
  • 3,042
  • 28
  • 53
0
votes
1 answer

Combining violin plots in R

I am trying to create a violin plot for a database with one dependent variable and three factors (CHANGE_TYPE, IA_TYPE, PRESENTATION). I can create a violin plot with 4 violins using: p <- ggplot(data, aes(factor(CHANGE_TYPE), mean_reading_rate)) p…
OvertOddity
  • 7
  • 1
  • 6
0
votes
1 answer

violin plot in python function and plotly

I have created a python function to draw a violin plot using plotly. The code for that is: def print_violin_plot(data1,data2,type1,type2,fig_title): data = pd.DataFrame(columns=('Group', 'Number')) for i in data1: x =…
SZA
  • 71
  • 2
  • 2
  • 3
0
votes
0 answers

R - error creating a violin boxplot for one raster

I'm trying to create a violin plot for a single raster (initially in GTiff). Using the library rasterVis, the code should be very simple: library(raster) library(rasterVis) rast <- raster("Temperate_WWR.tif") bwplot(rast) The code returns the…
0
votes
0 answers

Seaborn violin plot for pandas data

I have a pandas dataframe heights_table with following info: Columns: Age, Height. Rows: each person in data set I want to generate a seaborn violin plot from this data. On the x-axis I want range of ages, and on the y axis, I want a 'blob' of…
SashaGreen
  • 193
  • 1
  • 2
  • 9
0
votes
1 answer

Plot Additional Quantiles on Seaborn Violin Plots

Using the example on http://seaborn.pydata.org/generated/seaborn.violinplot.html: import seaborn as sns sns.set_style("whitegrid") tips = sns.load_dataset("tips") ax = sns.violinplot(x="day", y="total_bill", data=tips) (source: pydata.org) How…
p-value
  • 608
  • 8
  • 22