[ncl-talk] plot overlaid on multiple base plots...take 2

Adam Herrington adam.herrington at stonybrook.edu
Sun Aug 7 11:14:41 MDT 2016


Hi all,

I am struggling with overlaying a single contour plot (called 'tmp0' below)
over multiple plots in a panel. The script below results in the error
"fatal:NhlAddOverlay: tranform is already an annotation or overlay..."

  plot(1)  = gsn_csm_contour(wks,dz_m,res1)
  plot(3)  = gsn_csm_contour(wks,dy_m,res1)
  res1 at tiXAxisString          = "Latitude"
  plot(5)  = gsn_csm_contour(wks,dy_e,res1)
  delete(res1 at tiXAxisString)

  res2 at cnFillOn          = False
  res2 at cnLinesOn         = True
  res2 at cnLineThicknessF  = 2.
  res2 at cnLevelSelectionMode = "ManualLevels"
  res2 at cnLevelSpacingF = 5.e10;
  tmp0  = gsn_csm_contour(wks,psi1,res2)

  res2 at cnLevelSpacingF = 1.e10
  tmp1  = gsn_csm_contour(wks,dpsi,res2)

  overlay(plot(0),tmp0)
  overlay(plot(2),tmp0) ;<-fatal:NhlAddOverlay
  overlay(plot(4),tmp0) ;<-fatal:NhlAddOverlay
  overlay(plot(1),tmp1)
  overlay(plot(3),tmp1) ;<-fatal:NhlAddOverlay
  overlay(plot(5),tmp1) ;<-fatal:NhlAddOverlay
...
  gsn_panel(wks,plot,(/3,2/),resP)

In terms of finding a solution, I would prefer to keep all the overlays
contained in the graphics variable 'plot' so that I can easily perform a
panel plot. I don't think the solution provided by Mary Haley in
https://www.ncl.ucar.edu/Support/talk_archives/2013/3802.html would work
for me, since gsn_panel draws all the plots at once.

Any help is greatly appreciated!

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/09205cfa/attachment.html 


More information about the ncl-talk mailing list