[ncl-talk] Limiting X-axis for a line in the Spectrum analysis

S Br sbr.climate at gmail.com
Fri Jun 28 10:01:36 MDT 2019


Hi All,
I have generated the attached spectrum analysis with three series of data.
I have used overlay to plot three lines for this figure. In this, the
X-axis ranges from 0 to 100. However, I don't want to show one of the
spectrum line (e.g. Var3) beyond year 40. The first two series should show
the spectrum with the X-axis 0 to 100 year but third spectrum line should
plot up to year 40 (not beyond that).

I have tried by limiting the X-axis as shown below but doesn't work.

 res = True                                      ; no plot mods desired
   res at gsnDraw                =  False
   res at gsnFrame               =  False
   res at trYMinF              = 0                 ; manually set lower limit
Y axis
   res at trYMaxF              = 15             ; manually set upper limit Y
axis
   res at trXMinF              = 0                 ; manually set lower limit
X axis
   res at trXMaxF              = 100             ; manually set upper

  res at xyLineColors        = (/"green4"/) ; Line colours (white-to invisible
the markov line)
   plot(0) = gsn_csm_xy(wks, p1, spec1 at spcx, res)
   delete(res at gsnCenterString)    ; no center string for the following plot
   delete(res at gsnLeftString)    ; no center string for the following plot
   res at xyLineColors        = (/"red"/) ; Line colours (white-to invisible
the markov line)
   plot2 = gsn_csm_xy(wks, p2, spec2 at spcx, res)

   delete(res at trXMinF)
   delete(res at trXMaxF)
   res at trXMinF              = 0                 ; manually set lower limit
X axis
   res at trXMaxF              = 40             ; manually set upper limit X
axis
   res at xyLineColors        = (/"blue"/) ; Line colours (white-to invisible
the markov line)
   plot3 = gsn_csm_xy(wks, p3, spec3 at spcx, res)

   overlay(plot(0),plot2)
   overlay(plot(0),plot3)













Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190628/6e0001a6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spectrum_ovarlay.png
Type: image/png
Size: 49950 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190628/6e0001a6/attachment.png>


More information about the ncl-talk mailing list