Re: Complex panel plot w/ different coilor tables

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 24 2011 - 14:24:11 MST

Hi Maurice,
I have managed to use different colomaps on the same page by utilizing
the procedure shown in unique plots example #3 here:
http://www.ncl.ucar.edu/Applications/unique.shtml#ex3

(I know this technique works for .ps format but I am not sure if it
works for other output formats (x11, eps)..) The key is to make sure
that the first column of plots is actually drawn before you switch to
your second colormap.

I think you are doing that, in that by default gsn_panel draws the
plot(s) (and advances the frame). So I'm a little confused as to why the
1st label bar is not reflecting the colors of the first column.

If you simply make your first gsn_panel call and call frame(wks), does
the label bar beneath the column reflect the colors used of the first
column? Assuming the answer to is yes, then that means that the 2nd call
to gsn_panel is somehow affecting the first column's labelbar.. Instead
of using gsnPanelLabelBar, can you set lbLabelBarOn = False for the
first three panels of each plot and then set it to True for the 4th
panel? (You might have to set gsnPanelBottom = 0.07 or something similar
to leave room at the bottom of the page for the label bar.)

A 2nd possibility: Merge your two colormaps using gsn_merge_colormaps,
and then explicitly select the colors to be used for each set of plots.
Note that your workstation color limit is 256 colors.

Hope that helps..
Adam

On 01/24/2011 01:58 PM, Maurice.McHugh@noaa.gov wrote:
> Dear NCL-ers.
>
> Apologies if you receive this twice.
>
> I am trying to make a complex panel plot displaying 2 variables (temp. and precip. biases) using different color tables. My script mimics code in http://ncl.ucar.edu/Applications/Scripts/panel_12.ncl and is *Ualmost* right. The LHS column (temp.) and RHS column (precip.) both look fine and use their different color tables, and have seperate labelbars beneath each column. However, the issue I cannot solve is that the colors of the colorbar only come from the color table for precip -- the RHS column which was drawn last.
>
> How can I insert the correct label bar for the temperature column? I really don't want to have precip and temperature differences use the same color table. Nor do I want to split into two seperate plots.
>
> The misbehaving plot is attached, and relevant code snippet is below.
>
> Many thanks,
>
> Maurice
>
> ;--------------------------------------------------------------------------------------------------------
> ; Create panel. plotT and plotP are the graphical arrays containing the individual
> ; Temp and Precip plots for paneling.
> ;--------------------------------------------------------------------------------------------------------
>
> resP = True ; modify the panel plot
> resP@gsnPanelLabelBar = True ; add common colorbar
> resP@lbLabelFontHeightF = 0.007 ; make labels smaller
> resP@gsnFrame = False ; don't advance panel plot
>
> resP@gsnPanelYWhiteSpacePercent = 2.5
> resP@gsnPanelXWhiteSpacePercent = 2.5
>
> resP@gsnPanelFigureStrings= (/ "a)","c)","e)","g)" /) ; add strings to panel
> resP@txFontHeightF = .24
>
> resP@gsnMaximize = True
>
> resP@gsnPanelRight = 0.5 ; draw from left edge to center
>
> gsn_panel(wks,plotT,(/4,1/),resP) ; now draw as one plot
>
> ;--------------------------------------------------------------------------------------------------------
> ;--------------------------------------------------------------------------------------------------------
>
> resP2 = True
> resP2@gsnPanelLabelBar = True ; add common colorbar
> resP2@lbLabelFontHeightF = 0.007 ; make labels smaller
> resP2@gsnFrame = False ; don't advance panel plot
>
> resP2@gsnPanelYWhiteSpacePercent = 2.5
> resP2@gsnPanelXWhiteSpacePercent = 2.5
>
> resP2@txFontHeightF = .24
>
> resP2@gsnMaximize = True
> resP2@gsnPanelFigureStrings= (/ "b)","d)","f)","h)" /) ; add strings to panel
> resP2@gsnPanelLeft = 0.5 ; draw from center to right edge
>
> gsn_panel(wks,plotP,(/4,1/),resP2) ; now draw as one plot
>
> ;--------------------------------------------------------------------------------------------------------
> ; Add column labels to panel.
> ;--------------------------------------------------------------------------------------------------------
> txres = True
> txres@txFontHeightF = 0.0165
> gsn_text_ndc(wks,"RegCM",0.1,0.99,txres)
> gsn_text_ndc(wks,"CRU",0.9,0.99,txres)
> frame(wks)
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 24 14:24:16 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST