7

Here is the example in http://gnuplot.sourceforge.net/demo/pm3dcolors.html

set palette rgb 21,22,23; set title "hot (black-red-yellow-white)";

The above code set the hot palette. However I want a reversed hot palette, say:

white-yellow-red-black.

Small least value map to white and largest value map to black.

Changwang Zhang
  • 2,467
  • 7
  • 38
  • 64

2 Answers2

13

Miguel's answer is correct. Rather than making the individual numbers negative, the command set palette negative also does the trick:

set pm3d map
set palette negative rgb 21,22,23
splot x

would produce what you wanted. You can split the command up too:

set palette rgb 21,22,23
set palette negative

is equivalent. You can use set palette positive to undo this modification, or set palette to restore all the defaults (including the colours). Try help set palette for the full list of things you can do.

Tom Fenech
  • 72,334
  • 12
  • 107
  • 141
6

Use negative numbers to invert the palette:

set pm3d map
set palette rgb 21,22,23
splot x

gives you

enter image description here

whereas

set pm3d map
set palette rgb -21,-22,-23
splot x

gives you

enter image description here

Miguel
  • 7,497
  • 2
  • 27
  • 46