[ncl-talk] How to remember the overlaid plot inside a function

Mary Haley haley at ucar.edu
Tue Mar 7 08:36:31 MST 2017


Cheung,

See:

http://www.ncl.ucar.edu/FAQ/#err_msgs_027

When you get warnings about "tfPolyDrawList", this should have to do with
code where you are attaching polylines, polygons, polymarkers, or text to a
plot, and not in the creation of the plot itself.

Do you have any code where you are calling gsn_add_polyxxxx or
gsn_add_text? If so, then please read the above FAQ question about how to
make sure your return values for each call are unique.

--Mary


On Tue, Mar 7, 2017 at 7:44 AM, Cheung <zuibeidemei at 126.com> wrote:

> *Dear NCL:*
>
> *                   I use a function to generate certain type of plot.*
> *                   Inside this function, several plots are overlaid on a
> base plot, like this:*
>
> * function a*
>
> *                   rex at xxx           = xxx*
> *                   plot                   = gsn_csm_xy(wks,x,y,res)*
> *                   res at xxx           = xxx      ; call this as "res for
> plot1"*
> *                   plot1                 = gsn_csm_xy(wks,x,y,res)*
> *                   res at xxx           = xxx       ; call this as "res for
> plot2"*
> *                   plot2                 = gsn_csm_xy(wks,x,y,res)*
> *                   overlay(plot,plot1)*
> *                   overlay(plot,plot2)*
> *                   return(plot)*
>
> *end function a*
>
> *                    Such codes will generate "warning TransformPreDraw:
> tfPolyDrawList element 0".*
> *                    Although plot1 and plot 2 can be overlaid to the base
> plot when this function a is called, *
> *                    the resultant plot lose all "res for plot1, 2". **I
> guess this is because the new "res" are not *
> *                   "alive" when this plot is returned. **Is there any
> way to solve this?*
>
> *                    Thanks for your help.*
>
> *Best*
> *Cheung*
>
>
>
>
>
>
> _______________________________________________
> 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/20170307/1fbbd856/attachment.html 


More information about the ncl-talk mailing list