Reputation: 6739
I normally used set colorsequence podo
in gnuplot 5 to choose colors that are friendly to color blind individual.However my plot consist of 12
different keys and thus the line colors will repeat.How do i extend the colorspace to 12 colors from the default 8 while still taking care of color blindness and not having to specify the colors manually as far as possible.
Upvotes: 11
Views: 3454
Reputation: 3549
with dotted lines:
# color cycle 1, dt 1 = solid line
set linetype 1 lc rgb "dark-violet" lw 1 dt 1 pt 0
set linetype 2 lc rgb "sea-green" lw 1 dt 1 pt 7
set linetype 3 lc rgb "cyan" lw 1 dt 1 pt 6 pi -1
set linetype 4 lc rgb "dark-red" lw 1 dt 1 pt 5 pi -1
set linetype 5 lc rgb "blue" lw 1 dt 1 pt 8
set linetype 6 lc rgb "dark-orange" lw 1 dt 1 pt 3
set linetype 7 lc rgb "black" lw 1 dt 1 pt 11
set linetype 8 lc rgb "goldenrod" lw 1 dt 1
# color cycle 2, dt 3 = dot line
set linetype 9 lc rgb "dark-violet" lw 1 dt 3 pt 0
set linetype 10 lc rgb "sea-green" lw 1 dt 3 pt 7
set linetype 11 lc rgb "cyan" lw 1 dt 3 pt 6 pi -1
set linetype 12 lc rgb "dark-red" lw 1 dt 3 pt 5 pi -1
set linetype 13 lc rgb "blue" lw 1 dt 3 pt 8
set linetype 14 lc rgb "dark-orange" lw 1 dt 3 pt 3
set linetype 15 lc rgb "black" lw 1 dt 3 pt 11
set linetype 16 lc rgb "goldenrod" lw 1 dt 3
#
set linetype cycle 16
problem is, the png
terminal will keep showing solid lines, so we need the pngcairo
terminal:
set term pngcairo dashed size 800,600 font "sans" linewidth 3
to show smaller dots, use dt "."
Upvotes: 1
Reputation: 4218
Extending the colorspace can be done with a initialization file. From help set linetype
:
The recommended way to do this is to add to the run-time initialization file ~/.gnuplot a sequence of commands like
if ((GPVAL_VERSION < 4.5) \ || (!strstrt(GPVAL_COMPILE_OPTIONS,"+USER_LINETYPES"))) \ exit set linetype 1 lc rgb "dark-violet" lw 2 pt 0 set linetype 2 lc rgb "sea-green" lw 2 pt 7 set linetype 3 lc rgb "cyan" lw 2 pt 6 pi -1 set linetype 4 lc rgb "dark-red" lw 2 pt 5 pi -1 set linetype 5 lc rgb "blue" lw 2 pt 8 set linetype 6 lc rgb "dark-orange" lw 2 pt 3 set linetype 7 lc rgb "black" lw 2 pt 11 set linetype 8 lc rgb "goldenrod" lw 2 set linetype cycle 8
Every time you run gnuplot the line types will be initialized to these values. You may initialize as many linetypes as you like.
For colors which are friendly to colorblind people, help colorsequence
refers to an article from Wong (2011) [Nature Methods 8:441]. I don't have access to the article, but it seems that they have some images from this article online. And it seems that this article recommends only 8 colors.
Have you already thought about using dotted or dashed lines?
Upvotes: 6