Gerrit Groot - 2020-04-29

Hi,

Is there a way to stretch a part of the colorbox on the right hand side. Say, if I happen to have a colorbox from 0 to 10 and only want the colors from 0 to 1 to appear in the box.

I have a plot with values for (x,y,z) and plot y vs x. The value of z is given bij the color of the points and specified in a colorbox on the right hand side.

However, good z values fall between 0 and 1 and are colored with a gradient from green=0 to red=1. All values beyond 1 are points that should not be considered. These are colored blue.

Is there a way to show only the range from 0 to 1 in the colorbox but still keeping the points that color blue if z>1?

My script is:

set print "zstats.dat"
stats 'GnuplotQuestion.dat' using 3 nooutput name 'z_'
print sprintf("%f z_min", z_min)
print sprintf("%f z_max", z_max)
set grid
set key off
set title 'Gnuplot Question'
set xrange [0:4]
set yrange [0:4]
set xlabel 'x'
set ylabel 'y'
set palette model RGB defined (0 'green', 1/z_max 'red', 1/z_max 'blue', 1 'blue')
set cbrange [0:z_max]
plot 'GnuplotQuestion.dat' using 1:2:3 with points ps 2 pt 7 palette notitle

And my data are:

    1. 1.
    1. 0.5
    1. 0.2
    1. 7.
    1. 9.
    1. 10.
    1. 0.3
    1. 1.1
    1. 0.9

I attached my current plot where I would like the colorbox to go from 0 to 1 and stretch this out over the available vertical space, without losing the blue dots in the plot.

 

Last edit: Gerrit Groot 2020-04-29