Re: gsn_csm_xy (wks,tim,dots,res)

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 10 2011 - 10:55:18 MST

Hi Mark,
(answers below)

On 03/10/2011 10:28 AM, Mark Chan wrote:
> Dear NCL users,
> The attached files are ncl script, input data and a plot. The plot is what I
> wanted but with a trick to make it using "gsn_csm_xy".
> (1) why here did the "bot_plot = gsn_csm_xy (wks,tim,dots,res)" always ask
> 2-dimension data (dots), so I have to duplicate the same data one more time?

I replaced this line:
bot_plot = gsn_csm_xy (wks,tim,dots,res)
with this:
bot_plot = gsn_csm_xy (wks,tim,data(:,4),res)
or this:
dots2 = data(:,4)
bot_plot = gsn_csm_xy (wks,tim,data(:,4),res)

and I do not get any kind of error message running ncl6.0.0-beta

> (2) How to make "res@lbLabelStride= 1" work?

lbLabelStride can be used to set the labeling stride for a label bar. I
assume you want to alter the x-axis tickmark labels? If so:
res@tmXBMode = "Explicit"
res@tmXBValues = ispan(1,12,1)
res@tmXBLabels = res@tmXBValues
res@tmXBMinorValues = fspan(0,12,25)

see example #2 here:

> (3) How to overlay "dots" on the top?

Change this:
bot_plot = gsn_csm_xy (wks,tim,data(:,4),res) ; create dots
to this:
res@xyCurveDrawOrder = "PostDraw"
bot_plot = gsn_csm_xy (wks,tim,data(:,4),res) ; create dots plot

xyCurveDrawOrder is used to alter when xy Curves are drawn. See the draw
order page here:

Finally, keep in mind that you can only use the colors that are present
in the workstation colormap. As you are not loading a different colormap
by saying something like this:

you will only get the default colormap which is this:
(unless you are specifying a different colormap in your .hluresfile)

So when you specify "brown", NCL will try to grab the closest color to
brown from the current colormap. If brown is not present in the
colormap, then NCL will try to grab the closest color to brown, which
may or may not be a color anywhere close to brown.
Good luck,

> Thanks a lot!
> Mark
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

Adam Phillips
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Mar 10 10:55:23 2011

This archive was generated by hypermail 2.1.8 : Thu Mar 10 2011 - 21:44:37 MST