3

I have violin plots with non-numerical variables on the x-axis. Some of the violin plots are very wide and some of them very narrow due to their distribution. To avoid the overlap between the plots, I narrowed the width of the plots. However this time the plots that were already narrow look very hard to understand. I thought to increase the space between the plots to avoid overlap without narrowing the plots. How can I do that? Or maybe you can suggest any other option?

Here is the code that I am using in R and the outcome:

ggplot(dataviolin, aes(x=ROI, y=Values, fill=ROI) +
  geom_violin(width=1) + geom_boxplot(width=0.08)

outcome

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • 1
    Try `width = 0.8` and then making the width of the entire plot larger? For example `pdf(..., height = 5, width = 10)` to `pdf(..., height = 5, width = 12)`. – Ian Campbell Jun 24 '21 at 23:25

0 Answers0