stupidity
stupidity

Reputation: 437

Gnuplot: controlling colours and ranges of "set palette."

I'm using gnuplot to make a colour-map. What I need is, when I set a palette I need to define the ranges and colours such that certain ranges have the same colour.

For example, say the third column of the data ranges from 100 to 150. I need 100 to 120 to be same colour, then 120 to 130 same colour. I tried doing it this way

set palette defined (100:120 "gray", 121:129 "blue", 130:150 "dark-gray")

But it gnuplot says this is invalid expression, specifically pointing at the " : ".

Is there any way around this?

Upvotes: 1

Views: 11789

Answers (1)

mgilson
mgilson

Reputation: 310227

check out set palette maxcolors. From the help page:

This option can also be used to separate levels of z=constant in discrete steps, thus to emulate filled contours. Default value of 0 stays for allocating all remaining entries in the terminal palette or for to use exact mapping to RGB.

Also note that you should be able to do something like:

set palette defined ( 100 "gray", 120 "gray", 121 "blue", 129 "blue" )

but be careful -- the numbers 100, 120, 121, 129, etc don't correspond to the values on your colorbar unless you set cbrange [100:129] (for example).

Upvotes: 8

Related Questions