Re: @gsFillOpacityF does not work

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 26 2013 - 15:38:44 MST

What about trying the following:

rgba = new( (/1,4/), float)
rgba(:,0:2) = namedcolor2rgb("cornflowerblue") ; note lack of space in name!
rgba(:,3) = 0.5
res@gsnXYFillColors = rgba(0,:) ; or possibly just "… = rgba"

Untested, but it might get you what you need -- please let us know.

Rick

On Feb 26, 2013, at 3:01 PM, "H.Dang" <danghy@gmail.com> wrote:

> Hi dear NCL'er,
>
> I wanted to add shades besides the blue curve on the graph "Resolute_line.png" (please see attached). The way I plot this graph is through:
>
> data = new((/2,35/),float, -999.)
> data(0,:) = ozone_season
> data(1,:) = model_ozone_season
> plot=gsn_csm_xy(wks,data,pressure_sonde,res)
>
> When I tried to add shades, I added the following code:
>
> data_stddev = new((/2,35/),"float",-999.)
> data_stddev(0,:) = ozone_season - 5
> data_stddev(1,:) = ozone_season + 5
> delete(res@gsnXYFillColors)
> delete(res@xyLineColors)
> res@gsnXYFillColors = "cornflower blue"
> res@gsFillOpacityF = 0.5
> res@xyLineColor = -1 ; We don't want the line, so make it transparent.
> std_plot = gsn_csm_xy(wks,data_stddev(0:1,:),pressure_sonde,res) ; Create filled XY plot.
> overlay(std_plot,plot)
>
> But res@gsFillOpacityF doesn't work for me, so the blue curve in Resolute_line.png is totally covered by shades (please see attached Resolute_shade.png). The warning message is:
>
> warning:gsFillOpacityF is not a valid resource in /Fall_SON_modelEY_ozonesonde024_Resolute_xy at this time.
>
> The version of NCL that I'm using is 6.1.0-beta. Is there a way to add the blue line on the shade in this version? Thank you!
>
> Hongyan
> <Resolute_line.png><Resolute_shade.png>_______________________________________________
> 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
Received on Tue Feb 26 15:38:53 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 28 2013 - 14:47:31 MST