I am creating violin plots with lots (will be ~100) of columns (violins). The problem is that the name of each column is very long. What I am doing current is as follows:
jpeg("stats/AllDistanceViolinPlot.jpg", width = 1000, height = 1000);
do.call(vioplot, c(lapply(data, na.omit),list(names=c("veryveryveryverylongname1", "veryveryveryverylongname2", "veryveryveryverylongname4", "veryveryveryverylongname4", "veryveryveryverylongname5", "veryveryveryverylongname6", "veryveryveryverylongname7", "veryveryveryverylongname8"))));
dev.off()
Which gives me this plot:
As you can see, the names of the columns are very long and some actually are not shown. I have also tried something without the list:
jpeg("stats/plot.jpg", width = 1000, height = 1000);
do.call(vioplot, c(lapply(data, na.omit)));
dev.off()
Which gives me this plot:
What I'd like is one of two things:
- The names of the columns would be vertical so that they are shown and aren't cut off or
Make the main plot like the second image I posted and have a separate legend that would correlate each column with the full name. For example, something like the following:
1 - veryveryveryverylongname1 2 - veryveryveryverylongname2 ... 8 - veryveryveryverylongname8
Could someone please suggest the better way (or both) and comment on how to implement them?
Greatly appreciated.