I don't know how to directly get the number of colors
without opening a workstation.
If someone does ... please respond.
----
Here is one approach:
wks = gsn_open_wks("x11","test1")
gsn_define_colormap(wks,"BlWhRe")
cmap = gsn_retrieve_colormap(wks)
dimc = dimsizes(cmap)
nMax = dimc(0) ; max colors
For BlWhRe, it would be nMax=103
Hence, the start/end indices would be 2,102(=nMax-1)
You could create a function.
function getNumberColors (wks:graphic]
begin
cmap = gsn_retrieve_colormap(wks)
dimc = dimsizes(cmap)
nMax = dimc(0) ; max colors
return(nMax)
end
Kai Zhang wrote:
> Dear all,
>
> Is there a function which can tell me the beginning and ending index
> of a certain color table? I know that we can look it up on the NCL web
> site, but it is always nice to let NCL do it automatically. Thanks!
>
> Kai
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 24 2008 - 08:57:42 MDT
This archive was generated by hypermail 2.2.0 : Mon Sep 29 2008 - 13:35:43 MDT