Re: switching color maps in multi-panel plots

From: Paul Nutter (pnutter AT XXXXXX)
Date: Tue Jun 03 2003 - 13:17:42 MDT


I had been working on this for a while, but just discovered that
CSM graphics example "color_9.ncl" appears to answer my question
by merging color maps.

Paul Nutter

Paul Nutter wrote:
> Hi,
>
> I'm trying to draw a two-panel plot where each panel has a different
> color map. I've defined one workstation, then switch color map
> definitions when building each plot to the same workstation. It appears
> that only portions of the colormaps are replaced, and gsnSpreadColors
> fails to function properly. Relevent portions of my code follow... Any
> suggestions?
>
> Paul Nutter
>
> -----------
>
> gsn_define_colormap (xwks,"ncview_default")
> getvalues xwks
> "wkColorMap" : cmap1
> end getvalues
> cmap1(0,:) = (/1.,1.,1./)
> cmap1(1,:) = (/0.,0.,0./)
>
> gsn_define_colormap (xwks,"rainbow")
> getvalues xwks
> "wkColorMap" : cmap2
> end getvalues
> cmap2(0,:) = (/1.,1.,1./)
> cmap2(1,:) = (/0.,0.,0./)
> cmap2(2,:) = (/1.,1.,1./)
>
> twopanel = new(2,graphic)
>
> gsn_define_colormap(xwks,cmap1)
>
> twopanel(0) = gsn_csm_contour_map_ce(xwks,VORT,rsrc1)
>
> gsn_define_colormap(xwks,cmap2)
>
> twopanel(1) = gsn_csm_contour_map_ce(xwks,TPCP,rsrc4)
>
> gsn_panel(xwks,twopanel,(/2,1/),False) ; Draw as one plot
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
  Dr. Paul A. Nutter
  University of Oklahoma, CIMMS
  100 E. Boyd St. Rm 1110, Norman, OK 73019
  pnutter@ou.edu, (405) 325-1855

_______________________________________________ ncl-talk mailing list ncl-talk@ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Tue Jun 03 2003 - 13:38:53 MDT