[ncl-talk] Panel Plots + gsn_add_polymarker

Bassill, Nicholas nbassill at albany.edu
Thu Feb 6 09:34:44 MST 2020


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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200206/b0577fbc/attachment-0001.html>


More information about the ncl-talk mailing list