Re: gsn_contour_shade question

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 23 2013 - 22:43:19 MDT

Hi Marc,

I'm not familiar with the gsn_shade_contour code, so I took a quick look at it.

It does appear that if you set gsnShadeMid, then you can't set either gsnShadeLow or gsnShadeHigh. In fact, I think the only case where you can set more than one of these is gsnShadeLow and gsnShadeHigh.

I'm sure there must be a reason why it is coded this way, and hopefully Adam can chime in.

Meanwhile, I created a modified version of gsn_shade_contour ("gsn_shade_contour_mod") that does what I think you want.

I modified your example slightly to show different combinations of setting the three Shade resources. See the attached image and script.

--Mary

On Jul 23, 2013, at 5:11 PM, Marc Michelsen <marc@u.washington.edu> wrote:

> Hi NCLers,
>
> Are you supposed to be able to set gsnShadeLow and gsnShadeMid in the same gsn_contour_shade call?
> Here's a stripped down version of contour effects example 13:
>
> 803 challenger% cat coneff_13.ncl
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
> f = addfile ("uvt.nc", "r") ; add file
> lat = f->lat ; get latitude
> ind14S= ind(lat.eq.-1.395307) ; subscript index of 1.4S
> u = f->U(0,:,ind14S,:) ; get u at 1.4S
>
> wks = gsn_open_wks ("ps", "coneff" )
> res = True
> res@cnLevelSpacingF = 5.0
> res@gsnDraw = False ; We're going to panel later, so don't
> res@gsnFrame = False ; draw or advance frame.
> plot = gsn_csm_pres_hgt(wks, u, res )
> opt = True
> opt@gsnShadeLow = "red"
> ; opt@gsnShadeMid = "yellow"
> opt@gsnShadeHigh = "yellow"
> plot = gsn_contour_shade(plot, -10.,-5, opt)
> draw(plot)
> end
> 804 challenger%
>
> and it produces this plot:
> <jjhddgba.png>
>
>
> so I would like the current white area to be yellow and the current yellow area to be white
> so I make the follow change (i.e. I use gsnShadeMid rather than gsnShadeHigh)
>
> opt@gsnShadeLow = "red"
> opt@gsnShadeMid = "yellow"
> ; opt@gsnShadeHigh = "yellow"
>
> and this is what I get:
> <cbibgbdi.png>
> No filled colors, no errors or warning messages.
> I'm using NCL v 6.1.2
> Am I doing something wrong? is this supposed to work?
> Thanks,
>
> Marc
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

coneff.png
Received on Tue Jul 23 22:43:30 2013

This archive was generated by hypermail 2.1.8 : Thu Jul 25 2013 - 21:02:42 MDT