[ncl-talk] add annotation

Mary Haley haley at ucar.edu
Fri Jul 27 16:42:20 MDT 2018


Hi Laura,

I believe that once you add something as an annotation, you can't add the
same thing as an annotation again.  In fact, I'm guessing that's why you
called NhlRemoveAnnotation, because NCL probably gave you an error on the
second gsn_add_annotation call.

If you need to add the same text string twice, I recommend creating two
text strings and adding them separately:

;---Create two text objects
txid_1 = gsn_create_text(wks,"00 GMT-01 GMT",txres)
txid_2 = gsn_create_text(wks,"00 GMT-01 GMT",txres)


amres  = True
amres at amParallelPosF    = -0.38 ; This is the right edge of the plot.

amres at amOrthogonalPosF  =  0.35 ; This is the bottom edge of the plot.

amres2 = True
amres2 at amParallelPosF   =  0.00 ; This is the right edge of the plot.

amres2 at amOrthogonalPosF =  0.35 ; This is the bottom edge of the plot.


annoid_1  = gsn_add_annotation(plot,txid_1,amres)
annoid_2 = gsn_add_annotation(plot,txid_2,amres2)
draw(plot)
frame(wks)


On Tue, Jul 24, 2018 at 4:33 PM, Laura Fowler <laura at ucar.edu> wrote:

> Hello:
>
> I am trying to add some annotation in one of my plot following the example
> text_9.ncl. The plot show the orbit of a satellite and I am trying to add
> the time of the orbit on the plot. I do not have issue if I add the text
> once. If I add the same text box in an other part of the orbit, then part
> of the first text is hidden because I have to call "draw(plot)" a second
> time. How can I go around this issue?
>
> I am attaching the plot and sourcecode if helpful.
>
> Cheers,
> Laura
>
>
>
>
> --
> !-----------------------------------------------------------
> --------------------------------------------------
> Laura D. Fowler
>
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
> !-----------------------------------------------------------
> --------------------------------------------------
>
> _______________________________________________
> 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/20180727/19f317ea/attachment.html>


More information about the ncl-talk mailing list