[ncl-talk] Add/remove polymarker based on condition

Adam Phillips asphilli at ucar.edu
Fri Mar 27 11:38:16 MDT 2015


Hi Dave,
I think you actually can if you are OK with getting a few error messages..
I took animate_1.ncl and added a couple of gsn_add_polymarker calls that
would get invoked if a criteria was met. I then deleted the polymarker
graphic arrays (poly1/poly2 in my script) each time through the i loop.
What this does is "break" the polymarker creation when the criteria isn't
met because I am deleting the graphic array that houses the polymarker
information before the plot is drawn. You end up getting numerous
"warning:TransformPostDraw: tfPolyDrawList element # is invalid" error
messages but the markers are drawn when they would be.

See my attached script here. Hope that helps!
Adam

On Fri, Mar 27, 2015 at 11:26 AM, Rick Brownrigg <brownrig at ucar.edu> wrote:

> Hi David,
>
> I don't know definitively, but my guess is that the setvalues approach is
> not plausible.  Setvalues wants to operate on some resource associated with
> the polymarker, and to the best of my knowledge (and a quick look through
> the source code), there is no "visibility" type resource available.
>
> Rick
>
>
> On Thu, Mar 26, 2015 at 12:47 PM, David Craig <dcdavemail at gmail.com>
> wrote:
>
>> Hi,
>>
>> I am plotting a sequence of contour maps similar to the example script
>> animate_1.ncl. The data array for the contours is updated each iteration
>> using setvalues. I wish to add polymarkers to the maps based on a
>> condition being true in a particular iteration and remove them if the
>> condition is not through. Is it possible to do this using setvalues or
>> should I be redrawing the entire map each iteration??
>>
>> thanks in advance
>> Dave
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20150327/44b85cfc/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: animate_1.ncl
Type: application/octet-stream
Size: 5378 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150327/44b85cfc/attachment.obj 


More information about the ncl-talk mailing list