[ncl-talk] Avoiding overwritten gsnCenterString

Dennis Shea shea at ucar.edu
Thu Jun 20 13:36:45 MDT 2019


You can also *delete *the resource between plots
=====

   res at gsnCenterString     = "AMOnr PI"         ; change Center string
   res at gsnLeftString       = "(b)"         ; change Left string
   res at gsnStringFontHeightF = 0.010

   res at xyLineColors        = (/"green4"/) ; Line colours (white-to
invisible the markov line)
   plot(2) = gsn_csm_xy(wks, p11, spec1 at spcx, res)

   *delete(*res at gsnCenterString)    ; no center string for plot 2 or plot 3

On Thu, Jun 20, 2019 at 10:55 AM Karin Meier-Fleischer via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hi,
>
> why not go the easiest way and write the center string just once and set
> the others to an empty string.
>
> ;**********************************
> *   res at gsnCenterString     = "AMOnr PI"    ; change Center string*
>    res at gsnLeftString       = "(b)"         ; change Left string
>    res at gsnStringFontHeightF = 0.010
>
>    res at xyLineColors        = (/"green4"/)  ; Line colours (white-to
> invisible the markov line)
>    plot(2) = gsn_csm_xy(wks, p11, spec1 at spcx, res)
>
> *   res at gsnCenterString     = ""*
>    res at xyLineColors        = (/"red"/)     ; Line colours (white-to
> invisible the markov line)
>    plot2 = gsn_csm_xy(wks, p21, spec2 at spcx, res)
>
> *   res at gsnCenterString     = ""*
>    res at xyLineColors        = (/"blue"/)    ; Line colours (white-to
> invisible the markov line)
>    plot3 = gsn_csm_xy(wks, p31, spec3 at spcx, res)
>
>    overlay(plot(2),plot2)
>    overlay(plot(2),plot3)
> ;***************************************************
>
> Bye
> Karin
>
> Am 20.06.19 um 18:35 schrieb Adam Phillips via ncl-talk:
>
> You could put a carriage return in the gsnCenterString for plot2 and put
> two carriage returns in your plot3.
> https://www.ncl.ucar.edu/Document/Language/carriage.shtml
>
> This will result in the CenterString for plot3 being on top, the
> CenterString for plot2 being in the middle, and the CenterString for
> plot(2) being on the bottom.
> Hope that helps!
> Adam
>
> On Wed, Jun 19, 2019 at 1:58 PM S Br via ncl-talk <ncl-talk at ucar.edu>
> wrote:
>
>> Dear Dennis,
>> Is there any alternate solution to avoid this overwriting. Do I need to
>> set new resources for each overlay plot?
>> I have tried defining 'gsnCentreString' like below but in this case, the
>> resources written for plot(1) is also overwriting.
>>
>>     res at xyLineColors        = (/"green4"/) ; Line colours (white-to
>> invisible the markov line)
>>    plot(2) = gsn_csm_xy(wks, p11, spec1 at spcx, res)
>>    res at xyLineColors        = (/"red"/) ; Line colours (white-to
>> invisible the markov line)
>>    plot2 = gsn_csm_xy(wks, p21, spec2 at spcx, res)
>>
>>    res at gsnCenterString     = "AMOnr PI"         ; change Center string
>>    res at gsnLeftString       = "(b)"         ; change Left string
>>    res at gsnStringFontHeightF = 0.010
>>    res at xyLineColors        = (/"blue"/) ; Line colours (white-to
>> invisible the markov line)
>>    plot3 = gsn_csm_xy(wks, p31, spec3 at spcx, res)
>>
>>    overlay(plot(2),plot2)
>>    overlay(plot(2),plot3)
>>
>> On Wed, Jun 19, 2019 at 3:57 PM Dennis Shea <shea at ucar.edu> wrote:
>>
>>> re: "is there any 'AUTOMATIC' way to avoid overwriting the
>>> gsnCenterString?"
>>>
>>> Sorry, no.
>>>
>>>
>>> On Wed, Jun 19, 2019 at 4:03 AM S Br via ncl-talk <ncl-talk at ucar.edu>
>>> wrote:
>>>
>>>> Hi All,
>>>> I am generating a multi lines panel plot with multiple overlay command.
>>>> However, the 'gsngsnCenterString' defined is overwriting may be due to the
>>>> use of multiple 'overlay' command and the CenterString becomes thicker.
>>>> Is there any way to avoid overwriting the CenterString?
>>>> ;**********************************
>>>>   res at gsnCenterString     = "AMOnr PI"         ; change Center string
>>>>    res at gsnLeftString       = "(b)"         ; change Left string
>>>>    res at gsnStringFontHeightF = 0.010
>>>>
>>>>    res at xyLineColors        = (/"green4"/) ; Line colours (white-to
>>>> invisible the markov line)
>>>>    plot(2) = gsn_csm_xy(wks, p11, spec1 at spcx, res)
>>>>    res at xyLineColors        = (/"red"/) ; Line colours (white-to
>>>> invisible the markov line)
>>>>    plot2 = gsn_csm_xy(wks, p21, spec2 at spcx, res)
>>>>    res at xyLineColors        = (/"blue"/) ; Line colours (white-to
>>>> invisible the markov line)
>>>>    plot3 = gsn_csm_xy(wks, p31, spec3 at spcx, res)
>>>>
>>>>    overlay(plot(2),plot2)
>>>>    overlay(plot(2),plot3)
>>>> ;***************************************************
>>>>
>>>> Thank you.
>>>> SB
>>>>
>>>> _______________________________________________
>>>> 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
>
>
> _______________________________________________
> ncl-talk mailing listncl-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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190620/6e76fb92/attachment.html>


More information about the ncl-talk mailing list