5

I'm using Gnuplot 4.6. I have data files each containing 3 columns of data: X coordinate, Y coordinate and temperature. I wish to make an animation of plots of temperature as a function of X and Y coordinates. For this I'm using the following script:

set pm3d map; set palette;
do for [n=0:200] {splot sprintf("Temperature.%04d.dbl", n) binary array=100:100:1 form="%double" title 'file number'.n}

My problem is with the fact that after a few plots, the distribution of colors changes, both in the plot and in the legend. This makes the reading from the graph really hard. I consulted the following post:

gnuplot heat map color range

and since the range of the temperature variable is from 0.0 to 1.2 I thought to use:

set zrange [0.0:1.2]; set cbrange [0.0:1.2];

but it doesn't help and the temperature color continues to be autoscaled from plot to plot. Any suggestions?

Community
  • 1
  • 1
  • 1
    that's strange. Can you provide a complete minimal script reproducing the issue? i.e. the while gnuplot script + a sample of the data. – bibi Apr 09 '16 at 21:23

1 Answers1

5

In addition to setting cbrange, you could try defining your own palette by

set palette defined (0 "black",\
                     0.2 "red",\
                     0.4 "orange-red",\
                     0.6 "orange",\
                     0.8 "yellow",\
                     1.0 "light-green",\
                     1.2 "green")

enter image description here

Or if you want discrete values:

set palette defined (0 "black",\
                     0.2 "black",\
                     0.2 "red",\
                     0.4 "red",\
                     0.4 "orange-red",\
                     0.6 "orange-red",\
                     0.6 "orange",\
                     0.8 "orange",\
                     0.8 "yellow",\
                     1.0 "yellow",\
                     1.0 "light-green",\
                     1.2 "light-green")

enter image description here

F. Knorr
  • 3,045
  • 15
  • 22
  • This sets the palette but does not help to set the range of the colors in all of the sequential plots. I will try to better explain the problem: In some of the plots the temperature ranges in the legend (and in the plot itself) from 0 to 1.2, then it jumps in some of the other plots to the range 0 to 1.1 and by that changes all the color distribution and makes reading from the graph very hard. – Meir Zeilig-Hess Apr 11 '16 at 12:51
  • Strange! Can you provide your script that creates the plots? Can you try calling `set cbrange` each time before calling `plot`? – F. Knorr Apr 11 '16 at 16:37