[Thread Prev][Thread Next][Index]

Re: [ferret_users] shaded plot for discrete data

Hi David,
It's easy enough to get the color levels themselves that you want, I think. Ferret treats everything as continuous variables, but it really comes to the same thing if your data is all integers and the value of 15 is filled with a color that extends from 14.5 to 15.5. 

The only real issue then is the labeling of the colorbar, right?  Generating a simple variable and making a SHADE plot, here are the choices for the colorbar:
yes? let a = x[i=1:5:1] + y[y=1:7:1] - 1
yes? shade/lev=(1,12,1) a
or, more accurately, but not very pretty,
yes? shade/lev=(0.5,11.5,1) a
The colorbar labels don't really have any more control than this. You can control how many labels there are, and their size and precision; and the location and size of the colorbar itself, (http://ferret.pmel.noaa.gov/Ferret/faq/modifying-the-shade-key) but we don't have control over what numbers are labeled.

For a final publication plot, one could remove the colorbar labels using the shakey command, and put new ones on "by hand" with the LABEL command (or by modifying the plot in another graphics program), but that's an arduous process.

Anyone else have more ideas??


David Wang wrote:
Hi Ferreters,

I generated a 2D field whose values are the number of models (therefore all discrete integers). I intend to assign a color to each integer value (e.g., 15) instead of a value range (e.g., 14.5-15.5). In addition, the colorbar is to be labeled at the middle of each color box instead of the ends of it. Visually, I want something like this: http://blogs.mathworks.com/images/loren/95/indexTerm_01.png

Is it possible in Ferret?

life grows, death doesn't.

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement