[ncl-talk] get color names/values

Mary Haley haley at ucar.edu
Wed Jan 6 08:30:35 MST 2016


Hi Ioana,

I know Guido already answered your question, but I wanted to address the
issue of the getvalues error.

I didn't see your full code, but if you were calling something like
"gsn_csm_contour_map", then in order to retrieve the contour levels, you
need to do this:

plot = gsn_csm_contour_map(....)

;---Retrieve contour levels and colors
getvalues plot at contour
  "cnLevels"     : levels
  "cnFillColors" : colors
end getvalues

This is because "gsn_csm_contour_map" actually returns a map object, with
the contour object attached as an attribute called "contour".

--Mary


On Wed, Jan 6, 2016 at 5:53 AM, Ioana Colfescu <ioana.colfescu at ed.ac.uk>
wrote:

> Hi,
>
> I'd like to use exactly the same colors as in a first plot in a second one.
>
> I set the colors for plot 1 manually :
>
>    tres at cnFillPalette         = "BlWhRe"
>    tres at cnLevelSelectionMode  = "ManualLevels"
>    tres at cnMinLevelValF       = -0.03
>    tres at cnMaxLevelValF       =  0.03
>    tres at cnLevelSpacingF      =  0.005
>
> Does anyone know how can I get the exact colors ( name/index) used so
> that I can pass them on to the second one ? getvalue doesn't work and I
> get an error that says the cn levels are not defined.
>
> Thanks,
> Ioana
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> _______________________________________________
> 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/20160106/531f13fc/attachment.html 


More information about the ncl-talk mailing list