[ncl-talk] How to these three plots in one figure?

Anahita Amiri Farahani aamir003 at ucr.edu
Fri May 18 12:41:19 MDT 2018


Hi all,

I have three plots and want to create one plot with three panels how can I
do that. I've attached the figures here and also the script for them.



 wks = gsn_open_wks("eps","atm_sfc_fine")
;gsn_define_colormap(wks,"BlAqGrYeOrRe")
;gsn_define_colormap(wks,"BlWhRe")
 plot = new(2,graphic)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  res                     = True               ; plot mods desired
  res at cnFillOn            = True              ; turn on color
  res at gsnSpreadColors     = True               ; use full color map
  res at cnLinesOn           = False              ; no contour lines
  res at cnLineLabelsOn      = False              ; no line labels


 ; res at gsnAddCyclic        = False
  res at gsnDraw             = False           ; don't draw
  res at gsnFrame            = False           ; don't advance frame
  res at cnInfoLabelOn       = False           ; turn off cn info label
  res at cnFillOn            = True            ; turn on color
  res at gsnSpreadColors     = True            ; spread out color table
  res at gsnSpreadColorStart = 2               ; color to startt

  res at lbLabelBarOn        = False           ; turn off individual cb's

;  res at cnLevelSelectionMode =  "AutomaticLevels"   ; AutomaticLevels


  res at cnLevelSelectionMode =  "ManualLevels"   ; AutomaticLevels
  res at cnMinLevelValF       = -40.              ; min level
  res at cnMaxLevelValF       =  40.               ; max level
  res at cnLevelSpacingF      =  4               ; interval


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

res at gsnLeftString       = "Solar radiation absorption in the atmosphere"
     ; change left string
plot(0) = gsn_csm_contour_map_ce(wks,Absp,res)
res at gsnLeftString       = "Surface net flux"         ; change left string
plot(1) = gsn_csm_contour_map_ce(wks,sfc,res)






;************************************************
; create panel
;************************************************
  resP                  = True                    ; modify the panel plot

  resP at gsnPanelLabelBar = True                    ; add common colorbar
  resP at gsnPanelFigureStrings = (/"a)","b)"/)      ; add strings to panel
;resP at txString         = "Annual SDE changes at the surface"
resP at lbTitleString    = "W/m^2"                ; title string
resP at lbTitlePosition  = "Right"              ; title position
resP at lbTitleFontHeightF= .02                ; make title smaller
resP at lbTitleDirection = "Across"             ; title direction
gsn_panel(wks,plot,(/1,2/),resP)


delete(plot)
delete(res)
delete(resP)
delete(wks)











;************************************************
; plotting parameters
;************************************************
 wks   = gsn_open_wks ("eps","sfc_lat_summer")                  ; send
graphics to PNG file

 res                   = True                       ; plot mods desired
;res at tiMainString      = "Vertical profile of atmospheric heating rate"
         ; add title
res at tiYAxisString = "Surface net flux (W/m^2)"  ; xaxis string
res at tiXAxisString = "Latitude";Pressure levels (hPa)"

res at trYMinF     = -10;0 ; set minimum Y-axis value
res at trYMaxF     = 1;12250;1200 ; set maximum Y-axis value
;res at trXMinF     = -0.5      ; set minimum X-axis value
;res at trXMaxF     = 1.2      ; set maximum X-axis value
; res at trYReverse = True                     ; reverse Y-axis
res at xyDashPattern  = 0                         ; Make curves all solid
res at xyLineColors      = "blue"          ; change line color
res at xyLineThicknesses = 4.0
 plot  = gsn_csm_xy (wks,lat,sfc_summer2,res) ; create plot
;************************************************
delete(wks)




Thanks,
Ana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180518/f495dc7e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atmospheric_heating_rate_summer.eps
Type: application/postscript
Size: 563088 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180518/f495dc7e/attachment-0003.eps>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: surface_net_flux_summer.eps
Type: application/postscript
Size: 518776 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180518/f495dc7e/attachment-0004.eps>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vertical_profile_summer.eps
Type: application/postscript
Size: 200853 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180518/f495dc7e/attachment-0005.eps>


More information about the ncl-talk mailing list