[ncl-talk] Problem with overlay plot

Ipsita Putatunda ipsita.putatunda at gmail.com
Wed Aug 13 13:18:22 MDT 2014


Hi,
  I want to get an overlay plot of two plots which are created by attached
plot. I have tried with overlay function which is not giving my desired
plot. I tried with setting vpXF, vpYF for each plot also, but still am not
getting overlaid plot. Is attaching plots before overlaying is causing the
problem? Plotting part of my script is attached herewith.
Please help me to solve this issue.

Thanks,
Ipsita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140814/92502b29/attachment.html 
-------------- next part --------------
  wks=gsn_open_wks("X11","MERRA_vect")
; gsn_define_colormap(wks,"BlWhRe")
  gsn_define_colormap(wks,"WhBlGrYeRe")

  res=True
  res at gsnDraw             = False           ; don't draw
  res at gsnFrame            = False           ; don't advance frame
  res at cnLevelSelectionMode = "AutomaticLevels"        ; manual contour levels
  res at gsnAttachBorderOn=False
  res at cnFillOn             = True                  ; turn on color fill
  res at sfXArray=L3&lon
  res at sfYArray=L3&lev
  res at tiXAxisString = "longitude"                  ; x-axis label
  res at tiYAxisString = "Height (Km)"
  res at cnLineLabelsOn = False
  res at trXMinF = -30
  res at trXMaxF =  179
  res at cnLevelSelectionMode = "ExplicitLevels"; manually set the contour levels
  res at cnLevels =(/0.0,0.5,1.1,1.7,2.3,2.9,3.5,4.1,4.7/)
  res at cnLinesOn                   = False
  res at cnFillColors=(/0,5,20,44,49,77,82,90,96,99,1/)
  res at cnConstFLabelPerimOn=False
  res at vpWidthF =0.8
  res at vpHeightF =0.4
  res at vpXF =0.1
  res at vpYF =0.6
   res1=True
   res1 at gsnDraw             = False           ; don't draw
  res1 at gsnAttachBorderOn=False
   res1 at gsnFrame            = False           ; don't advance frame
   res1 at vcRefMagnitudeF           = 20.0           ; define vector ref mag
   res1 at vcRefLengthF              = .018
   res1 at trYReverse        =True
   res1 at vcMinDistanceF =.03
   res1 at vcGlyphStyle="FillArrow"
   res1 at vcFillArrowWidthF=0.09
   res1 at vcFillArrowMinFracWidthF=1.0
   res1 at trXMinF = -30
   res1 at trXMaxF =  179
   res1 at vcFillArrowHeadYF=0.05
   res1 at tmYROn = False
   res1 at tmYRBorderOn = False
   res1 at tmYLLabelsOn = False
   res1 at vpWidthF =0.8
   res1 at vpHeightF =0.4
   res1 at vpXF=0.1
   res1 at vpYF=0.6

     res2=True
   res2 at gsnDraw             = False           ; don't draw
   res2 at gsnFrame            = False           ; don't advance frame
  res2 at gsnAttachBorderOn=False
   res2 at vcRefMagnitudeF           = 20.0           ; define vector ref mag
   res2 at vcRefLengthF              = .018
   res2 at trYReverse        =True
   res2 at vcMinDistanceF =.03
   res2 at vcGlyphStyle="FillArrow"
  res2 at vcFillArrowWidthF=0.09
  res2 at vcFillArrowMinFracWidthF=1.0
   res2 at vpXF=0.1
   res2 at vpYF=0.6
   res2 at vcFillArrowHeadYF=0.05
   res2 at trXMinF = -180
   res2 at trXMaxF =  -30
   res2 at vpWidthF =0.8
   res2 at vpHeightF =0.4

   res3=True
  res3 at gsnDraw             = False           ; don't draw
  res3 at gsnAttachBorderOn=False
  res3 at gsnFrame            = False           ; don't advance frame
  res3 at cnLevelSelectionMode = "AutomaticLevels"        ; manual contour levels
  res3 at cnFillOn             = True                  ; turn on color fill
  res3 at sfXArray=L3&lon
  res3 at sfYArray=L3&lev
  res3 at tiXAxisString = "longitude"                  ; x-axis label
  res3 at tiYAxisString = "Height (Km)"
  res3 at cnLineLabelsOn = False
  res3 at cnLevelSelectionMode = "ExplicitLevels"; manually set the contour levels
  res3 at cnLevels =(/0.0,0.5,1.1,1.7,2.3,2.9,3.5,4.1,4.7/)
  res3 at cnLinesOn                   = False
  res3 at cnFillColors=(/0,5,20,44,49,77,82,90,96,99,1/)
  res3 at cnConstFLabelPerimOn=False
  res3 at trXMinF = -179
  res3 at trXMaxF = -30
   res3 at vpWidthF =0.8
   res3 at vpHeightF =0.4
   res3 at vpXF=0.1
   res3 at vpYF=0.6

; plot=new(2,graphic)
  plot_A = gsn_contour(wks,LH4(:,:),res)
 plot_B = gsn_contour(wks,LH4(:,:),res3)
 plot_AB=gsn_attach_plots(plot_A,plot_B,res,res3)
  draw (plot_A)
 plot_X   = gsn_csm_vector(wks,U,wscale,res1)
  plot_Y   = gsn_csm_vector(wks,U,wscale,res2)
  plot_XY   = gsn_attach_plots(plot_X,plot_Y,res1,res2)
  draw (plot_X)
;overlay(plot_AB,plot_XY)
; plot=plot_AB

;   res=True
; res at gsnMaximize=True
; gsn_panel(wks,plot,(/1,2/),res)     ; now draw as one plot

   frame(wks)

 end


More information about the ncl-talk mailing list