When plotting color-maps using gnuplot, I usually use the following lines:
...
set palette rgbformulae 33,13,10
plot "file.dat" using 1:2:3 with points pointtype '7' palette
Usually the range of the third point (appearing in the legend) is automatically set by gnuplot. But how can I change that? say I want the range of the 3rd point to be from 0 to 1500.
Any suggestions?
Best Answer
This is actually a really good question -- assuming you mean that you want the colorbar range to be determined (not the legend [i.e. key] -- the legend doesn't typically have that information).
My first thought was
set cbrange
. This might do what you want --However, the question is then "What do you want to happen to out of range points?" This solution will move out of range points to the bottom/top of the scale (e.g. purple for negative numbers, red for numbers greater than 1500). My next thought was that you should be able to clip those points out by
set zrange [0:1500]
-- But that doesn't work. You have at least 2 options at this point.Option 1: use splot:
Your borders will be slightly different than they were before, but that's no real big deal.
Option 2: filter with the ternary operator (which you already know about from your previous question):
Also, for plotting color maps, you may want to look into the
pm3d
plotting style (image
might work too). You might need to restructure your datafile slightly, but plotting color maps is that plotting style's bread-and-butter.