[ncl-talk] transparency in xy line plot

Julie Arblaster julie.arblaster at monash.edu
Mon May 2 22:14:32 MDT 2016


Hi Rick,

Yes, I¹m using xyLineColors and was using a combination of named colours and
ones I¹d created myself using NhlNewColor. I had tried adding a 4th
component to NhlNewColor but see now we don¹t need to use that at all and
can just create the 4-tuple arrays. Thanks for the tips, it works well now.

Julie



From:  Rick Brownrigg <brownrig at ucar.edu>
Date:  Tuesday, 3 May 2016 at 12:27 PM
To:  Julie Arblaster <julie.arblaster at monash.edu>
Cc:  "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
Subject:  Re: [ncl-talk] transparency in xy line plot


Hi Julie,


How are you setting the color(s) of the 30 ensemble members?  If they are
being set to one color via xyLineColor, and set with a 3-tuple, you can of
course make that a 4-tuple with the 4th component being translucency.  If
they are set via an array of 3-tuple colors and xyLineColors, the you can do
something like:

   dims = dimsizes(myColors)
   myColorsWithAlpha = new((/ dims(0), dims(1)+1/), float)
   myColorsWithAlpha(:, 0:2) = myColors
   myColorsWithAlpha(:, 3) = 0.25   ; sets all colors alpha/tranlucency to
.25

If they are set via one or more named colors, there's the function
"namedcolor2rgba" that would give you an array of 4-tuples, from which you
can set the alpha channel accordingly.

If none-of-the-above, please send me the relevant code fragments and I'll
see if I can't help.

FWIW...the lack of a xyLineOpacityF resource seems like an omission, and may
indeed be a bug ticket (if not, it will be!).

Rick


On Mon, May 2, 2016 at 7:21 PM, Julie Arblaster <julie.arblaster at monash.edu>
wrote:
> Hello,
> 
> I am using gsn_csm_xy to plot 30 timeseries from 30 ensemble members on one XY
> plot. I would like to make these slightly transparent using the new color
> model so that when I overlay the ensemble mean it stands out but is in the
> same colour. But I can't find a xyLineOpacityF resource. Can I achieve this
> somehow with other resources easily?
> 
> Thanks,
> Julie
> 
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160503/670c82bb/attachment.html 


More information about the ncl-talk mailing list