[ncl-talk] Panel Plots + gsn_add_polymarker

Rick Brownrigg brownrig at ucar.edu
Thu Feb 6 10:30:23 MST 2020


Hi Nick,

I'm not totally certain here, but since for each plot, you draw the markers
for snow enmasse, I think you'll get back one plot ID for the collection of
markers drawn on that plot. So I would think all you need to do is create a
1D snow variable the same size as your "plot" variable and then each time
through the loop assign the polymarkers to "snow(i)".



On Thu, Feb 6, 2020 at 9:35 AM Bassill, Nicholas via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hi All,
>     I *think* I have a fairly simple question. If I want to add
> polymarkers to a series of panels, but the number of polymarkers changes by
> panel, what's the best way to do this?  If I have something like:
>
> --------
>    plot = new(24,graphic)
>    do i=0,23
>        plot(i)= gsn_csm_contour_map(wks,newdata(i),res)
>     mres                = True
>     mres at gsMarkerIndex  = 16
>     mres at tfPolyDrawOrder= "Draw"
>
>     roadcond := allroad(:,i)
>     mres at gsMarkerSizeF  = 1.5         ; marker size
>     mres at gsMarkerColor  := "blue"      ; marker color
>    if any(roadcond.eq.3)
>        snowlons := roadlons(ind(roadcond.eq.3))
>        snowlats := roadlats(ind(roadcond.eq.3))
>        snow= gsn_add_polymarker(wks,plot(i),snowlons,snowlats,mres)
>    end if
>
>    [more if tests clipped here]
>
> end do
>
> gsn_panel(wks,plot,(/6,4/),panelres)
>
> -------------
>
> I'll get a bunch of warnings like "warning:TransformDraw: tfPolyDrawList
> element 0 is invalid", presumably because I'm overwriting "snow" every
> loop, which results in only the last panel showing the polymarkers.
> However, since the size of snow varies randomly by panel, it's not easy to
> prematurely make a 2-dimensional array for "snow". Plus, there's a lot of
> polymarkers (~1000)
>
> I *could* go through and repeat this process individually for each panel,
> but that would be a significant waste of code/lines. Does anyone have a
> better suggestion?
>
> Thanks!
>
> Nick Bassill, PhD
>
> Director of Research & Development, Center Of Excellence
>
> Affiliated with NYS Mesonet
>
> LC SB-28, 1400 Washington Ave.,
>
> SUNY, University at Albany, NY 12222
> Contact: (518) 442-6375 | @NickPBassill |
> http://operations.nysmesonet.org/~nbassill/
> _______________________________________________
> 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/20200206/b2fb401a/attachment.html>


More information about the ncl-talk mailing list