401 questions
3
votes
1
answer
158
views
Add significant differences in brackets in a half-violin plot
I am trying to make a half-violin plot. I want to add the significant differences as brackets above the halves, with an asterisk indicating significance.
Because I want to group the data into two ...
1
vote
1
answer
92
views
Horizontal segments in violin plot in R [duplicate]
I am looking for a way to implement horizontal segments inside a violin-plot in R. I attach an image displaying how I need the plot to look like. I tried using ggplot2, which I am fairly experienced ...
3
votes
1
answer
115
views
How do I plot two grouped sets of violin plots on a single X axis using MATLAB's violinplot?
The code below creates violin plots grouped by mean values. I'm currently plotting these grouped violin plots next to each other using subplots. How would I modify the code to get them to plot onto a ...
1
vote
1
answer
80
views
Separating groups in plot when using gradient fill
I'm using stat_ydensity (co-opted from the violin plot) to shade bar density using color rather than size.
This code does what I need, when using a single category:
library(tidyverse)
set.seed(100)
n &...
1
vote
2
answers
111
views
How to adjust size of violin plot based on number of hues available for each category?
I need to create a violin plot based on two categories. But, some of the combination of categories are not available in the data. So it creates a white space, when i try to make the plot. I remember ...
1
vote
1
answer
45
views
Object missing or new axis labels made using ggpubr::stat_pvalue_manual on violin plot with fill aspect
I have ran into a problem with using ggpubr::stat_pvalue_manual with a ggplot2 violin plot that has a fill aspect. There is either an issue of the fill aspect group not being found as an object or the ...
1
vote
0
answers
31
views
Violin plot - Concatenating two violins in one
I have a dataframe for which I am plotting violin plot. The dataframe has two categories A and B and highly imbalance data (one df has 1000 samples/rows and other has 200). I want to compare both ...
0
votes
1
answer
76
views
How to construct a grouped line plot using ggstatsplot without faceting?
I could manage to construct a line plot as required with ggplot2, but I couldn't replicate the same using ggstatsplot, a package that has many aesthetically pleasing defaults
I am attaching the ...
0
votes
2
answers
447
views
Setting the x-position of violin plots in Seaborn
I have some code that creates a violin plots (with 10 violins) using Seaborn:
sns.violinplot(data=chain[:, -10:], ax=ax, inner=None, linewidth=1)
ax.set_xticks(np.arange(10)) # Adds spacing between ...
0
votes
1
answer
107
views
Show frequency in a violin plot
I'm using matplotlib's violinplot and I'd like to see the frequency values in the X axis.
This is my MWE:
import numpy as np
import matplotlib.pyplot as plt
data = np.random.normal(size=100)
plt....
0
votes
1
answer
48
views
How to save matplotlib violinplots with axes? Tried using fig.tight_layout() but the saved plots are without axes or labels or titles
My codes are as follows:
import matplotlib.pyplot as plt
import numpy as np
data_to_plot = [avg[0]['Cell Perimeter (unit pixel side)'], avg[1]['Cell Perimeter (unit pixel side)'], avg[2]['Cell ...
2
votes
0
answers
11
views
How do I move the boxplot and datapoints, together, a bit to the left?
I am visualising the data for the bill depth for these birds for 1976 and 1978. I want a single figure showing boxplot + datapoints, next to the half violin plot, for each year.
I have managed to get ...
1
vote
1
answer
63
views
plot horizontal cutoff lines on top of boxplots
I have a violin+boxplots plot I do with the iris data as an example, like this:
data(iris)
iris_long <- as.data.frame(tidyr::pivot_longer(iris, -Species, names_to = "variable", values_to =...
1
vote
1
answer
129
views
How to create flipped grouped violin plot with facet_grid with keeping same proportions of violin plot with ggplot2 in R
I want to create a flipped violin plot (with extra points for group means in geom_point() and lines from min to max values in geom_segment() ). I integrated the groups as facets with facet_grid().
The ...
0
votes
2
answers
154
views
R display a violin plot over curve
I would like to draw on the same plot a curve and some violin plots. Is it possible ?
For now, I'm only able to draw them separately, one of the top of the other as in the example code.
Here is an ...