Open chunlai425 opened 7 months ago
Hi, your code should work, but the command is violinplot
, not vioplot
. ben
Thank you! That works. Now, I would like to plot the data points in each violin and change the color of the data points per group. I used: violinplot variant, over(group) vertical colors(plasma) fill nomedian nobox nowhiskers rag(spread(5) msymbol(o) mcolor(blue%50))
All the data points are the same color, blue.
Is it possible to change the color for data points per each group?
Thank you
It is. By default, option colors()
affects both the colors of the violins and the colors of the data points. Example:
sysuse nlsw88
violinplot wage, over(race) vertical fill nomedian nobox nowhiskers ///
rag(spread(5) msymbol(o)) ///
colors(plasma)
Use option ragcolors()
you want different colors for the data points. Examples:
violinplot wage, over(race) vertical fill nomedian nobox nowhiskers ///
rag(spread(5) msymbol(o)) ///
colors(plasma, intensity(.5)) ragcolors(plasma)
violinplot wage, over(race) vertical fill nomedian nobox nowhiskers ///
rag(spread(5) msymbol(o)) ///
colors(plasma) ragcolors(carto sunset)
ben
Thank you so much! It works
Hi, I would like to change the color of each violin. I have tried : vioplot variantA, over(variantB) vertical colors(plasma) It said "option colors() not allowed"
Any solution?
Thanks