[ncl-talk] trouble making plot legend with a loop
Adam Herrington
adam.herrington at stonybrook.edu
Wed Aug 16 16:57:38 MDT 2017
Thank you Karin for finding my bug!!!
Guido, I thicken the border by setting res at tmBorderThicknessF = 4
On Wed, Aug 16, 2017 at 3:33 PM, Karin Meier-Fleischer <
meier-fleischer at dkrz.de> wrote:
> Hi Adam,
>
> change the following line in the loop from
>
> plot@$tstr$ = gsn_add_text(wks,plot(1),plabel(n),xx(1),yy,res_text)
>
>
> to
>
> plot@$tstr$ = gsn_add_text(wks,plot(1),plabel(n),xx(1),*yy(n),*res_text)
>
>
> Bye,
> Karin
>
> Am 16.08.2017 um 22:52 schrieb Guido Cioni <guidocioni at gmail.com>:
>
> Hey Adam,
> I’m not sure whether it is right or not but it seems to me that the lines
> defining the plot area are thicker than they are supposed to. Are you by
> any change calling the draw(plot) twice, maybe by forgetting to set a false
> resource, advancing the frame or overlying different plots?
>
> Maybe the entire script would help, or at least the part where you’re
> setting the resources for the legend or calling the draw(plot).
>
> Il giorno 16 ago 2017, alle ore 22:42, Adam Herrington <
> adam.herrington at stonybrook.edu> ha scritto:
>
>
> Hi all,
>
>
> I'm trying to come up with a routine thats produces a plot legend using a
> loop. However, my attempts to do so corrupts the text labels. See attached
> plot as an example. The code for this loop is:
>
>
> plabel = (/" ne30_old", \
>
> " ne30_new", \
>
> " ne60_old", \
>
> " ne60_new", \
>
> " ne120_old",\
>
> " ne120_new",\
>
> " ne240_old",\
>
> " ne240_new"/)
>
>
> xx = (/1.,2.5/)
>
> yy = (/985.,978.,971.,964.,957.,950.,943.,936./)
>
> do n = 0,nfiles-1
>
> res_lines at gsLineColor = colors(n)
>
> lstr = unique_string("rum")
>
> tstr = unique_string("hum")
>
> plot@$lstr$ = gsn_add_polyline(wks,plot(1),xx,(/yy(n),yy(n)/),res_lines)
>
>
> plot@$tstr$ = gsn_add_text(wks,plot(1),plabel(n),xx(1),yy,res_text)
>
> end do
>
>
> Can anyone figure out why my legend labels are, what appears to be,
> 'doubly' printed?
>
>
> Adam
>
> <Screen Shot 2017-08-16 at 2.31.25 PM.png>_______________________
> ________________________
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170816/ca360cae/attachment.html
More information about the ncl-talk
mailing list