How to use the Ferret ccbar.jnl script
Below is an annotated version of the script ccbar_demo.jnl
It calls the script (Included in the Ferret distribution) ccbar.jnl
ccbar_demo.jnl (5/02)
Description: demonstrate continuous colorbar on plots that use color fill and shade.
The script ccbar.jnl defines a new viewport and fills that viewport
with a shade plot of a variable that has the desired range of levels.
The arguments of ccbar.jnl are as follows:
! GO ccbar x1 x2 y1 y2 v1 v2 dv orient palette ! x1 = x lo limit of rectangle for the colorbar ! x2 = x hi limit of rectangle for the colorbar ! y1 = y lo limit of rectangle for the colorbar ! y2 = y hi limit of rectangle for the colorbar ! v1 = lo value on colorbar ! v2 = hi value on colorbar ! dv = delta value for clorbar axis ! ! orientation = v for vertical or h for horizontal, default v ! palette to use, optional
Where the first four arguments define a rectangle, as a fraction
of the entire plot page. This is equivalent to how DEFINE VIEWPORT
works. Its qualifiers /XLIMITS=x1,x2 and /YLIMITS=y1,y2 allow the
user to specify a portion of the graphics window as the viewport.
We will replot the variable defined above, but hold off on the colorbar
Next, a pretty one using the ETOPO topography/bathymetry set, with a horizontal color key at the top. This one uses the palette argument.
Now, what if you we want a continuous colorbar for a plot in a viewport? The location parameters are still a fraction of the whole plot page. We must locate the colorbar as a viewport keeping in mind how the shade-plot viewport relates to the scale of the entire page. The SHOW VIEWPORT command helps here. Let's go back to the variable created for the first plot, and put that plot in two pre-defined viewports, UL and LR.