3

I'm plotting multiple transects together. With two transects plotted, the color scheme is what I'm looking for. When I plot a third, it changes. If I zoom in with three transects plotted, I again get the desired color differentiations. Why does it change like this? Is it a limit of gnuplot, my video card, monitor, or just my understanding of gnuplot?

I'm running a 4k monitor at 4k resolution on a 1.5GB Intel Iris graphics card on a 2015 MacBook Pro. There are ~8,000 - ~11,000 points in each transect.

Undesired color palette: enter image description here

Desired color palette, with zoom: enter image description here

My code:

reset
set object 1 rectangle from screen 0,0 \
    to screen 1,1 fillcolor rgb 'black' behind 
set view 49,15
set grid ztics
set palette model RGB
set palette defined (1 'cyan', 300 'blue', 650 'green', \
                     1500 'yellow', 3000 'red', \
                     5000 'brown', 15000 'black', 50000 'black')

splot 'line_01.dat' u 2:1:3:4 w p pt 1 palette, \
      'line_03.dat' u 2:1:3:4 w p pt 1 palette, \
      'line_04.dat' u 2:1:3:4 w p pt 1 palette
Nazim Kerimbekov
  • 4,712
  • 8
  • 34
  • 58
Josh
  • 61
  • 4

1 Answers1

2

By default the palette maps the full range of Z values in the current plot. If you add/subtract/change the surfaces shown in the plot then the range of Z values may expand or contract, causing a change in the color mapped to a specific Z value.

You can prevent this by fixing the range of Z values used in the color mapping so that it is independent of the current plot content. For example

set cbrange [0:1000]

Will map the current palette onto Z values in the range 0 - 1000. Pixels with Z values outside this range will receive the max or min extreme color.

Ethan
  • 13,715
  • 2
  • 12
  • 21