Re: ShadeLtContour, a color conflict

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 10 Mar 2009 16:39:46 -0600

Hi Gwenaelle,

I don't think ShadeLtContour was designed for you to color fill and
pattern fill at the same time. ShadeLtContour will wipe out all color
filling and replace it with pattern filling.

What you can do is create 1 plot with color fill, create another with
pattern fill, and then overlay:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
   f = addfile("toto.nc","r")
   t = f->TS(0,:,:)
   t = t -273.15

   wks = gsn_open_wks ("ps", "toto" ) ; open workstation
   res = True ; plot mods desired
   res_at_gsnDraw = False ; do not draw
   res_at_gsnFrame = False ; do not advance
   res_at_cnFillOn = True ; Turn on color

   plot1 = gsn_csm_contour_map(wks, t, res )

   res_at_cnFillOn = False
   res_at_gsnLeftString = ""
   res_at_gsnRightString = ""
   res_at_gsnCenterString = ""
   plot2 = gsn_csm_contour(wks, t, res )
   plot2 = ShadeLtContour(plot2,-10.,17)
   overlay(plot1,plot2)
   delete(plot2)
   draw(plot1)
   frame(wks)
end

Finally, it is recommended that you use gsnContourShade instead of
ShadeLtContour, which has been deprecated...
Hope that helps..
Adam

Gwenaelle wrote:
> Hi all,
>
> I am trying to shade an area over a colored contour plot (lat/lon).
>
> I have succeed to reproduce the shading over the map without a color
> table (without the line " res_at_cnFillOn = True ", see the script
> bellow).
> But when I add this line, I obtain a map in Black and White with the
> contour + the shading + the color table BUT no colored map.
>
> I don't figure out what is the problem in that script? Is the function
> Shade appropriate for my plot?
>
> Your help is much appreciated.
>
> Thanks,
> Gwenaelle
>
> ;***********************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> begin
>
> f = addfile("toto.nc","r")
> t = f->TS(0,:,:)
> t = t -273.15
>
> wks = gsn_open_wks ("ps", "toto" ) ; open workstation
> res = True ; plot mods desired
> res_at_gsnDraw = False ; do not draw
> res_at_gsnFrame = False ; do not advance
> frame
> res_at_cnFillOn = True ; Turn on color
>
> plot = gsn_csm_contour_map(wks, t, res )
> plot = ShadeLtContour(plot,10.,17)
>
> draw(plot)
> frame(wks)
> end
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               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 Tue Mar 10 2009 - 16:39:46 MDT

This archive was generated by hypermail 2.2.0 : Thu Mar 12 2009 - 14:10:21 MDT