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

How to create seaborn violinplot with mean,median and mode displayed?

Is there a way to add a mean and a mode to a violinplot ? I have categorical data in one of my columns and the corresponding values in the next column. I tried looking into matplotlib violin plot as it technically offers the functionality I am…
VSP
  • 359
  • 3
  • 14
2
votes
2 answers

Seaborn violin plots don't align with x-axis labels

I am attempting to build a violin plot to illustrate depth on the y-axis and a distance away from a known point on the x-axis. I am able to get the x-axis labels to distribute appropriately spaced on the x-axis based on the variable distances but i…
phil
  • 23
  • 1
  • 4
2
votes
1 answer

Trying to export 6 violin subplots (made using seaborn) (formatted into 3 rows and 2 columns) to a single page PDF

I need to export 6 violin subplots made using seaborn through python onto a single page PDF. They need to be formatted into 3 rows x 2 columns. Right now my code is generating a single page PDF with 6 empty plots and in the console this grid of…
GKC2024
  • 21
  • 1
2
votes
1 answer

geom_violin using the weight aesthetic unexpectedly drop levels

library(tidyverse) set.seed(12345) dat <- data.frame(year = c(rep(1990, 100), rep(1991, 100), rep(1992, 100)), fish_length = sample(x = seq(from = 10, 131, by = 0.1), 300, replace = F), nb_caught = sample(x =…
2
votes
1 answer

Pairing samples with violin plot in R

I'm trying to reproduce this graph from ggpaired (ggpubr) but with violin plot instead of boxplot: before <-c(200.1, 190.9, 192.7, 213, 241.4, 196.9, 172.2, 185.5, 205.2, 193.7) after <-c(392.9, 393.2, 345.1, 393, 434, 427.9, 422, 383.9, 392.3,…
Gabriel G.
  • 555
  • 1
  • 3
  • 13
2
votes
0 answers

Creating multiple violin plots

I have a data frame with 43 different numeric variables and one categorical variable with 823 rows(patients). I need a violin plot for each numeric variable(each column) grouped based on the categorical variable.The categorical variable has…
2
votes
0 answers

Adding labels to violin plot: Median, upper end and lower end

As you can see below my violin chart is lacking labels for the median, the y-axis and the upper boundary, which I would like to add. I experimented with plt.text(40,5,'This text ends at point (40,5)',horizontalalignment='right') to place the…
Janman
  • 67
  • 8
2
votes
0 answers

Add boxplot and stats to split violin plot in ggplot2 (R)

I love the split violin plot and @jan-glx 's awesome geom_split_violin function created here: Split violin plot with ggplot2. I would love to add split boxplots and stats to this, as I explain below. First, to be complete, here are the full data and…
Sylvia Rodriguez
  • 1,203
  • 2
  • 11
  • 30
2
votes
1 answer

How to change border color of violin plot in pandas graph?

I want to change the color of lineborder of violinplots. I can set lines.linewidth to 0 but I want to show borders not to hide them. How to change the color of the border? sns.set_context("paper", rc={"lines.linewidth": 0.8}) My code is as…
mickeyze2
  • 31
  • 5
2
votes
1 answer

how to modify seaborn violin plot legend

I have created a simple violin plot from a bands DataFrame (df10 below) using seaborn: fig, ax = plt.subplots(figsize=(10,4)) ax = sns.violinplot(x='z', y='z_fit', hue='new_col', data=df10, cut=0, palette='Blues',…
Alessandro Peca
  • 873
  • 1
  • 15
  • 40
2
votes
1 answer

Gnuplot smooth curve through frequency points + filled area under curve

I am a gnuplot-newbie and am stuck with the following situation. Based on this I have a gnuplot script as follows: clear reset set key off set border 3 set style fill solid 1.0 noborder bin_width = 0.01; set boxwidth bin_width…
Wolfone
  • 1,276
  • 3
  • 11
  • 31
2
votes
1 answer

How to get different colors related to treatment for boxplot and violin plot (ggplot / using geom_split_violin) that are plotted in one?

I am trying to show a boxplot and a violin plot in one. I can fill in the colors of the boxplot and violin plot based on the treatment. But, I don't want them in exactly the same color, I'd prefer the violin plot or the boxplot filling to be…
2
votes
2 answers

transform histogram to violin plot in r with ggplot

I am currently trying to learn r with the help of Hadley Wickham's great resources ("r for data scientists", "ggplot2 Elegant Graphics for Data Analysis"). So far I was able to find answers to all my problems there (thank you so much, Hadley!), but…
Dome
  • 21
  • 6
2
votes
1 answer

aes() and aes_string() produce different behaviors in split_violin_plot

I am trying to use a function from this post to produce a split violin plot. Here's the code: GeomSplitViolin <- ggproto("GeomSplitViolin", GeomViolin, draw_group = function(self, data, ..., draw_quantiles = NULL){ data <- transform(data, xminv =…
Xiao
  • 36
  • 5
2
votes
1 answer

geom_violin overlapping plots

By default, the neighboring violins will touch each other at the widest point if the widest point occurs at the same height. I would like to make my violin plots wider so that they overlap each other. Basically, something more similar to a ridge…
burger
  • 5,683
  • 9
  • 40
  • 63