Search code examples
gnuplot

How to be sure that my scale axis does not vary from a graph to the other with the same set palette defined?


I am plotting maps of interactions between residues of differents proteins. The maps should have the same z scale. x,y are the residue number of the proteins, z is the pourcentage of interaction. I used set palette defined (0.0 "white", 1. "green") And I expected that for each data the map would be plot with a scale ranging from 0 to 1. However the range adapts systematically to the maximum and minimum, and for example instead of having a color range from 0 to 1, everything is rescaled from 0 to 0.25 because no values superior at 0.25 are present in the specific data. Hence my maps are not similar and cannot be compared.

I have only found that autoscale is automatically applied. However, when I unset autoscale The map is all green. Below is my gnuplot script.

reset set title "G2-5 Fondaparinux Hbonds Hbonds" set palette defined (0.0 "white", 1. "green") set xtics 5 border mirror set ytics 5 border mirror set xrange [0:49] set yrange [47.5:63] set nokey set terminal svg size 1024,748 set xlabel "DGL residue number" set ylabel "Heparin residue number" set output 'G5_F_Hbonds_Hbonds.svg' plot 'G5F.txt' u 1:2:(1.0):6 w p pt 5 ps var lc palette z

Corresponding graph : enter image description here


Solution

  • To pin the two ends of the defined color palette to predetermined values, use set cbrange [min:max]. In this case

      set cbrange [0:1]