Gnuplotting / gnuplot-palettes

Color palettes for gnuplot
410 stars 67 forks source link

Overriding default palette #1

Open Lenbok opened 9 years ago

Lenbok commented 9 years ago

It may be worth including as a note in the readme, that it's possible to use these palettes to override the default, so that line styles do not need to be explicitly specified in plot commands. The method I use is a pair of commands like this:

palettefile(n) = sprintf("<sed 's/set style line/set linetype/' /path/to/gnuplot-palettes/%s.pal", n)
load palettefile("puor")

These can be put in your .gnuplot file to take effect on startup, and you can then call the load palettefile to select a different palette when desired.

Of course, if there is a better way to accomplish this, it would be good to know.

jingchangshi commented 5 years ago

Using this way, it reports errors.

        G N U P L O T
        Version 5.2 patchlevel 7    last modified 2019-05-29

        Copyright (C) 1986-1993, 1998, 2004, 2007-2018
        Thomas Williams, Colin Kelley and many others

        gnuplot home:     http://www.gnuplot.info
        faq, bugs, etc:   type "help FAQ"
        immediate help:   type "help"  (plot window: hit 'h')

Terminal type is now 'qt'
set linetype 1 lt 1 lc rgb '#B35806'
               ^
"<sed 's/set style line/set linetype/' /home/jcshi/software_profile/gnuplot/gnuplot-palettes/puor.pal" line 8: linetype definition cannot use linetype
Lenbok commented 5 years ago

I currently use this:

palettefile(n) = sprintf("<sed -e 's/set style line/set linetype/' -e 's/lt 1 //' /path/to/gnuplot-palettes/%s.pal", n)
load palettefile("dark2")
jingchangshi commented 5 years ago

I currently use this:

palettefile(n) = sprintf("<sed -e 's/set style line/set linetype/' -e 's/lt 1 //' /path/to/gnuplot-palettes/%s.pal", n)
load palettefile("dark2")

It works. Thanks!