[ncl-talk] question about contour opacities
Will Hobbs
will.hobbs at utas.edu.au
Thu Mar 25 16:19:04 MDT 2021
Thanks Rick, I hadn’t thought of changing the colormap itself. I’ll let you know it comes out.
will
From: Rick Brownrigg <brownrig at ucar.edu>
Date: Thursday, 25 March 2021 at 11:58 pm
To: Will Hobbs <will.hobbs at utas.edu.au>
Cc: "ncl-talk at mailman.ucar.edu" <ncl-talk at mailman.ucar.edu>
Subject: Re: [ncl-talk] question about contour opacities
Hi Will,
Offhand, I would think you could set up a custom colormap that consisted of RGBa tuples, which were all the same value for the 1st 3 components, and only the opacity (alpha) channel varied. Something like:
myColors = new((/100,4/_, float) ; colormap of 100 values
do i=0,99
mColors(i,:) = (/ 0., 0., 1., i / 100. /) ;; transparent to solid blues
end do
Then set either cnFillPalette or cnFillColors to "myColors"
http://ncl.ucar.edu/Applications/rgbacolor.shtml<http://ncl.ucar.edu/Applications/rgbacolor.shtml>
Hope that helps...
Rick
On Thu, Mar 25, 2021 at 12:43 AM Will Hobbs via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Hi all
I suspect the answer is ‘no’, but is it possible to set multiple values for cnFillOpacity?
I’d like to plot an overlay that has a single fill color, but uses opacity as it’s ‘colourmap/contour level’.
I can see a way of doing this by looping through each contour level and setting explicit levels/opacities each time, but I wonder if there’s a more efficient way.
Will
Will Hobbs
Institute for Marine and Antarctic Studies (IMAS)
University of Tasmania
Private Bag 80, Hobart, 7001, TAS, AUSTRALIA
+61 3 6226 2970
imas.utas.edu.au<http://imas.utas.edu.au>
aappartnership.org.au<https://aappartnership.org.au>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk<https://mailman.ucar.edu/mailman/listinfo/ncl-talk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210325/a94a531b/attachment.html>
More information about the ncl-talk
mailing list