Question

I would like to plot with image.plot from the fields package using the default palette in reverse order. In the help page it says

Color table to use for image ( see help file on image for details). Default is a pleasing range of 64 divisions suggested by Tim Hoar and is similar to the MATLAB (TM) jet color scheme.

So I figured out the easiest way was to sort in decreasing order, problem is the vector of colour is in hexadecimal, how do you do it? convert in decimal and then convert it back? Is there an easier/more intelligent way to go?

Was it helpful?

Solution

image.plot in fields uses:

col = tim.colors(nlevel)

so simply use:

col = rev(tim.colors(64))

in your call to image.plot - change the 64 to whatever nlevel you want.

[Note that rainbow colour palettes aren't always the best choice anyway...]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top