0
votes

I am plotting something like 40 plots on the same figure in gnuplot 5. The standard palette quickly runs out of colors, so that it's impossible to distinguish which plot is which. An example (with 10 plots instead of 40, for clarity) is below enter image description here

If I could tell gnuplot to change dashtype as it runs out of colors, I would easily be able to tell the plots apart. How can I do that?

Nota Bene: the linetype behaviour changed in gnuplot 5. Commands that work in gnuplot 4 will probably fail in gnuplot 5.

1

1 Answers

1
votes

A possible solution is to change the dashtype every eight plots. In a plot for command, this can be done like this:

plot for [i = 70:80] 'run'.i.'/e2e.txt' every 1 u 1:2 w l t ''.i dashtype i/8

enter image description here

this works, but the dashtype used are the 7 and 8 ones, which are quite similar to each other and hard to tell apart. Also this is a manual way of fixing it, and therefore error-prone and has to be re-engineered every time I plot something different. Ideally, I would like to change the default linestyle so that the change is performed automatically.

I'm posting the answer here to share a possible solution, in case someone needs it before a better one is provided.