Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

colorsequence for more than 8 colors gnuplot

Tags:

gnuplot

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.

like image 613
user2650277 Avatar asked Oct 16 '17 17:10

user2650277


1 Answers

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?

like image 128
maij Avatar answered Oct 19 '22 14:10

maij