Re: Help overlaying contours

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 23 2011 - 16:14:21 MDT


Generally, you can only have one colormap per page of NCL graphics. There's an exception to this if you draw the plot with the first color table before you change color tables.

You are unable to do that in your case (since both plots are being overlaid on another plot), so my recommendation is to use gsn_merge_colormaps to merge the two color tables of interest, and then use gsnSpreadColorStart and gsnSpreadColorEnd to indicate where to start and end the colors for each plot.

For example, right after you call gsn_open_wks, add the following call:


Comment out the two calls to gsn_define_colormap.

To control the colors for the "hgt" contours, you will need to add:

opts_h@gsnSpreadColorStart = 2 ; this is the default
opts_h@gsnSpreadColorEnd = 17 ; The default is -1 (last color in table)

You are already setting cnFillColors for the other plot, so you don't need to set the above resources. However, you are using named colors, and if these colors are not already in your existing merged color tables, you may not get the colors you're expecting.

If that happens, you can add them yourself, using NhlNewColor. See example 5 at:


On Mar 23, 2011, at 1:25 PM, Luis C. Cana Cascallar wrote:

> Dear all,
> I'm trying to draw one plot including streamlines, terrain height and cloud water content. I would like to use a two different color maps for each contour (terrain and qcloud). The script seem to be mixing both color maps and settings. What is wrong or what is missing? See attached script.
> Best regards, Luis.
> <Stream_en_niveles_p.ncl>
> <Luis Cesareo Cana Cascallar.gif>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Wed Mar 23 16:14:27 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT