Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding default palette #1

Open
Lenbok opened this issue Jul 2, 2015 · 3 comments
Open

Overriding default palette #1

Lenbok opened this issue Jul 2, 2015 · 3 comments

Comments

@Lenbok
Copy link

Lenbok commented Jul 2, 2015

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
Copy link

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
Copy link
Author

Lenbok commented Oct 5, 2019

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants