1
votes

How do I set up predefined point styles in Gnuplot? Since I am colorblind and I really dislike the standard colors of Gnuplot (colors 3 4 and 5 are blue, blue and blue for me), I made a list in a .gnuplot file in my home directory with some more friendly colors. This file looks like this

set style line 1 lt 5 lw 5 lc rgb "red"
set style line 2 lt 6 lw 5 lc rgb "blue"
set style line 3 lt 2 lw 5 lc rgb "olive"
set style line 4 lt 3 lw 5 lc rgb "salmon"
set style line 5 lt 4 lw 5 lc rgb "black"
...

But when I want to plot data points, it uses the same original Gnuplot colors. Is there a way to define points in the same way as these lines? For example, the first point type are black boxes and the second are red triangles etc

1

1 Answers

0
votes

With such a file you must either explicitely specify the respective line style with

load 'mycolors.gp'
plot x linestyle 1, 2*x linestyle 2

or you use set style increment user which should automatically use line styles instead of line types:

load 'mycolors.gp'
set style increment user
plot x, 2*x

But beware, that using set style increment user is deprecated.

In your case, the best option is to redefine directly the linetypes:

set linetype 1 lt 5 lw 5 lc rgb "red"
set linetype 2 lt 6 lw 5 lc rgb "blue"
set linetype 3 lt 2 lw 5 lc rgb "olive"

plot x, 2*x, 3*x

As side note: you must keep in mind that set linetype is not affected by reset.

You may also want to try out the colors defined in the files share/colors_default.gp and share/colors_podo.gp, which are shipped with the gnuplot binary (see the last image on Gnuplot line types to see how these look like).