I’m trying to present data in a boxplot with a few additions.
On top of the boxplot, i want to also print all the data points, since there aren’t that many.
There will be many boxplots side by side, and the data points will correspond, so each data point in one plot will be represented in another boxplot, however their order can change. That’s why I want to color the points.
I got this so far:
plot data using (1):($1) with boxplot,\
data using (1):($1) with points lc variable
[more plots...]
This needs an extra column in each datafile, that specifies the linecolor. Which works fine, if I had such a column, or if I could care to add it.
Is there another way to iterate through the linestyles (or colors), so it plots the first point with style 1, the second with style 2 etc.?
It seems like a real easy problem, that’s either solved by some command I can’t seem to find, or maybe by taking the linestyles from a different file, which would be the same for all plots (if that works in gnuplot).
Furthermore, I’d like to know if the boxplot command has the additional feature of being able to plot the average as well (or do I absolutely need the stats command from gnuplot 4.6, or some kind of hack).
Sometimes it’s just nice to be able to simply add the average in a boxplot.
Yes. Gnuplot provides a number of
pseudo-columns. To get more information, seeBut the gist of it is that you can use
column(0)for this. I believe that iteration starts at 0 though. Since there isn’t als 0, you’ll need to add 1.I believe that you need either gnuplot 4.6 or some kind of hack. One such hack (which will work using gnuplot 4.4, but not earlier) could be:
If your version of gnuplot is earlier than 4.4, you’ll need to use a shell command to compute the average. Something like
awkshould suffice.