Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GNUPLOT: How to set reverse HOT color palette

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.

like image 843
Changwang Zhang Avatar asked Apr 16 '14 19:04

Changwang Zhang


1 Answers

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.

like image 79
Tom Fenech Avatar answered Oct 19 '22 03:10

Tom Fenech