[ncl-talk] gsn_add_txt in panel plot

Debasish Hazra debasish.hazra5 at gmail.com
Tue Nov 30 11:27:40 MST 2021


I am trying to add gsn_add_txt and polymarks in panel plot of 12 figures
with 1st figure will show locations and index of stations but in the final
figure I am getting the circles but not texts in the figure itself.
Following is part of the code where I am setting up my ncl code to add
polyres and txts. Any help on this would be appreciated.

res      = True               ; plot options desired
  res at gsnAddCyclic = False
  res at gsnMajorLatSpacing = 10             ; change maj lat tm spacing
  res at gsnMajorLonSpacing = 20
SNIP........
mkres = True
    mkres at gsMarkerIndex = 17     ; Filled circle
    mkres at gsMarkerSizeF = 0.02

     latd = (/24.7,26.73, 49.09,38.43/)
    lond = (/-26.95,-22.93,-38.02, -36.24/)

         polyres               = True          ; poly marker mods desired
     polyres at gsMarkerIndex = 17            ; choose circle as polymarker
     polyres at gsMarkerSizeF = 0.01           ; select size to avoid streaking
     polyres at gsMarkerColor = (/"red"/)   ; choose color

        txres = True
        txres at txFont        = 19           ; Change the default font.
        txres at txFontHeightF = 0.008         ; Set the font height.
        txres at txJust        = "TopLeft"
        txres at txFontColor   = "Black"
;;         txres at txFont = "helvetica-bold"
       txres at txFuncCode    = "~"
           strs = (/"1","2","3","4"/)

          res at gsnCenterString   = labes(0)
        plot_A(0) = gsn_csm_contour_map_ce (wks, msd1(:,:), res)
        dum1=gsn_add_polymarker(wks,plot_A(0),lond,latd,mkres)
        dum2=gsn_add_text(wks,plot_A(0),strs(0),-28,23,txres)
        dum3=gsn_add_text(wks,plot_A(0),strs(1),-23,27,txres)
        dum4=gsn_add_text(wks,plot_A(0),strs(2),-38,50,txres)
        dum5=gsn_add_text(wks,plot_A(0),strs(3),-36,40,txres)
        res at gsnCenterString   = labes(1)
        plot_A(1) = gsn_csm_contour_map_ce (wks, msd2(:,:), res)
SNIP.......
 gsn_panel(wks,plot_A,(/3,4/),pres1)

;        draw(plot_A)
        frame(wks)

Thanks
Debasish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211130/e16071eb/attachment.html>


More information about the ncl-talk mailing list