Re: Different colormaps for panel plots

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 16 2009 - 12:26:46 MST

Hi Ashley,
(The following is true for .eps/.ps generation. I'm not sure if it will
work for x11 windows.)

To do what you want, you need to draw each panel on the page before you
switch your colormap. I can think of 2 ways to accomplish this:
1) Still use gsn_panel, specifying
gsnPanelBottom/ganPanelTop/gsnPanelRight/gsnPanelLeft to position each
of the tree plots individually, and to keep the sizes the same. For example:

    gsn_define_colormap(wks,cmap1)
    plot = gsn_csm_contour_map(wks,precip,res1)
   pnlres@gsnPanelLeft = .05
   pnlres@gsnPanelRight = 0.3
    gsn_panel(wks,plot,(/1,1/)pnlres)

    gsn_define_colormap(wks,cmap2)
    plot = gsn_csm_contour_map(wks,temp,res2)
    pnlres@gsnPanelLeft = 0.35
    pnlres@gsnPanelRight = 0.6
    gsn_panel(wks,plot,(/1,1/)pnlres)

    gsn_define_colormap(wks,cmap3)
    plot = gsn_csm_contour_map(wks,elev,res3)
    pnlres@gsnPanelLeft = 0.65
    pnlres@gsnPanelRight = 0.9
    gsn_panel(wks,plot,(/1,1/)pnlres)

2) Specify each plot's location on the page using vpYF, vpXF, vpWidthF,
and vpHeightF (manually paneling).
     Each resource list would have the same vpWidthF/vpHeightF/vpYF
settings.

     res1@vpHeightF = 0.4
     res1@vpWidthF = 0.3
     res1@vpYF = 0.7
    res1@gsnFrame = False
     res1@gsnDraw = True ; default

     res2@vpHeightF = res1@vpHeightF
     .....(and so on)

    res1@vpXF = 0.1
    plot = gsn_csm_contour_map(wks,precip,res1)

    res2@vpXF = 0.4
    plot2 = gsn_csm_contour_map(wks,temp,res2)

    res3@vpXF = 0.7
    plot3 = gsn_csm_contour_map(wks,elev,res3)
--------------------------------
I think option 2 is the way to go. Easier to control things more
directly via the vp resources. NCL will maintain the proper aspect ratio
for the map, so keep that in mind with regards to the settings for
vpWidthF/vpHeightF.

Either way you go it will definitely be a trial by error approach, as
you'll have to run the script a bunch of times. The procedure
drawNDCGrid might help you to position stuff, so you may want to look at
that:
http://www.ncl.ucar.edu/Document/Functions/Shea_util/drawNDCGrid.shtml

Good luck,
Adam

Ashley Watson wrote:
> Dear NCL users,
>
> I am trying to create 3 plots on one page each with its own
> user-defined colormap. The part of the script is given below.
> It doesn't seem to work for me as all 3 plots show colors defined as
> colormap "cmap3" (see below).
>
> Regards
> Ashley
>
>
> begin
> ........
> ........
> ........
> plot = new(3,graphic)
>
> gsn_define_colormap(wks,cmap1) ; Define a color map for
> 1st plot
> plot(0) = gsn_csm_contour_map(wks,precip,res1)
>
> gsn_define_colormap(wks,cmap2") ; Define a color map
> for 2nd plot
> plot(1) = gsn_csm_contour_map(wks,temp,res2)
>
> gsn_define_colormap(wks,cmap3") ; Define a color map for
> 3rd plot
> plot(2) = gsn_csm_contour_map(wks,elev,res3)
>
> gsn_panel(wks,plot,(/1,3/),pnlres)
>
> end
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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 Nov 16 12:27:21 2009

This archive was generated by hypermail 2.1.8 : Tue Nov 17 2009 - 17:27:42 MST