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

S Br sbr.climate at gmail.com
Sun Jun 30 06:22:43 MDT 2019


Hi Adam,
Thanks for the explanations. It worked fine.

Best,
SB

On Fri, Jun 28, 2019 at 8:43 PM Adam Phillips <asphilli at ucar.edu> wrote:

> As you are overlaying plot3 onto plot(0), NCL will use the X-axis range
> used in plot(0) to display the overlaid plot.
> I believe Rick is recommending that you set spec3 at spcx to _FillValue when
> p3 > 40.
> Adam
>
> On Fri, Jun 28, 2019 at 1:32 PM S Br via ncl-talk <ncl-talk at ucar.edu>
> wrote:
>
>> Hi Rick,
>> To calculate spectrum we need full length of data which is about 500
>> years. Which parameter do you ask me to _FillValue for years greater than
>> 40?
>>
>> Thanks.
>> SB
>>
>> On Fri, Jun 28, 2019 at 5:17 PM Rick Brownrigg <brownrig at ucar.edu> wrote:
>>
>>> I don't know for certain, but what about setting the data for the 3rd
>>> line to _FillValue for years greater than 40?
>>>
>>> Rick
>>> On Fri, Jun 28, 2019 at 10:02 AM S Br via ncl-talk <ncl-talk at ucar.edu>
>>> wrote:
>>>
>>>> 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.
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190630/743ec71e/attachment.html>


More information about the ncl-talk mailing list