Foo Bar
Foo Bar

Reputation: 1892

How to access default automatic colors in gnuplot?

When you do a plot without explicitly giving color names/values, then gnuplot chooses some pretty ones for you. So,

plot x, x*x

will be in two different colors. How can I access these color values?

I want to plot two functions, and use a different axis for each, and each axis label should be the same color as the function - but I want to use the default colors automatically (because I don't have time and art skills to find out good colors by myself). So basically I'm looking for a command option/variable similiar to

set y2label 'y2-axis' textcolor SAME_AS_PLOT_AUTOMATIC

Upvotes: 2

Views: 1439

Answers (1)

Christoph
Christoph

Reputation: 48390

The color of the labels can be controlled with the textcolor option which can also take an integer number which specifies the color of the respective line type:

set ylabel 'First axis' textcolor lt 1
set y2label 'Second axis' textcolor lt 2
plot x, x**2 axes x1y2

Upvotes: 2

Related Questions