[ncl-talk] Sub: Plots not fit into specified region..
Adv
advita6 at gmail.com
Tue Mar 15 22:10:04 MDT 2016
Hi,
I would like to plot lat and lon mentioned below. But the plot I attached
here over the globe. I think all the res_map properties looks fine. But
why the figure is like this? Could someone help me to fix this?
Thanks
latS = 40.
latN = 49.
lonL = -116.
lonR = 90.
wks = gsn_open_wks("pdf","eof")
gsn_define_colormap(wks,"BlWhRe") ; choose colormap
plot = new(neof,graphic) ; create graphic array
; only needed if paneling
; EOF patterns
res = True
res at gsnDraw = False ; don't draw yet
res at gsnFrame = False ; don't advance frame yet
;---This resource not needed in V6.1.0
res at gsnSpreadColors = True ; spread out color table
res at gsnAddCyclic = False ; plotted dataa are not cyclic
res at mpFillOn = False ; turn off map fill
res at mpLimitMode = "LatLon"
res at mpMinLatF = latS ; zoom in on map
res at mpMaxLatF = latN
res at mpMinLonF = lonL
res at mpMaxLonF = lonR
res at cnFillOn = True ; turn on color fill
res at cnLinesOn = False ; True is default
;res at cnLineLabelsOn = False ; True is default
res at lbLabelBarOn = False ; turn off individual lb's
res at mpPerimOn = True ; draw box around map
res at mpGeophysicalLineThicknessF = 3.0
res at mpGeophysicalLineColor = "Black"; (/22/)
;res at mpNationalLineThicknessF = 3.0
res at mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state boundaries
res at mpNationalLineColor = res at mpGeophysicalLineColor
res at mpUSStateLineThicknessF = 3.0
res at mpUSStateLineColor = res at mpGeophysicalLineColor
; set symmetric plot min/max
symMinMaxPlt(eof, 16, False, res) ; contributed.ncl
; panel plot only resources
resP = True ; modify the panel plot
resP at gsnMaximize = False ; large format
resP at gsnPanelLabelBar = True ; add common colorbar
resP at lbLabelAutoStride = True ; auto stride on labels
yStrt = yyyymm(0)/100
yLast = yyyymm(nyrs-1)/100
; resP at txString = "SLP: "+season+": "+yStrt+"-"+yLast
;*******************************************
; first plot
;*******************************************
do n=0,neof-1
res at gsnLeftString = "EOF "+(n+1)
res at gsnRightString = sprintf("%5.1f", eof at pcvar(n)) +"%"
plot(n)=gsn_csm_contour_map_ce(wks,eof(n,:,:),res)
end do
;*******************************************
; second plot
;*******************************************
; EOF time series [bar form]
rts = True
rts at gsnDraw = False ; don't draw yet
rts at gsnFrame = False ; don't advance frame yet
rts at gsnScale = True ; force text scaling
; these four rtsources allow the user to stretch the plot size, and
; decide exactly where on the page to draw it.
rts at vpHeightF = 0.40 ; Changes the aspect ratio
rts at vpWidthF = 0.85
rts at vpXF = 0.10 ; change start locations
rts at vpYF = 0.75 ; the plot
rts at tiYAxisString = "mm/day" rts at gsnYRefLine =
0. ; reference line
rts at gsnXYBarChart = True ; create bar chart
rts at gsnAboveYRefLineColor = "red" ; above ref line fill red
rts at gsnBelowYRefLineColor = "blue" ; below ref line fill blue
; panel plot only resources
rtsP = True ; modify the panel plot
rtsP at gsnMaximize = True ; large format
rtsP at txString = "Prec: "+season+": "+yStrt+"-"+yLast
year = yyyymm/100
; create individual plots
do n=0,neof-1
rts at gsnLeftString = "EOF "+(n+1)
rts at gsnRightString = sprintf("%5.1f", eof at pcvar(n)) +"%"
plot(n) = gsn_csm_xy (wks,year,eof_ts(n,:),rts)
end do
gsn_panel(wks,plot,(/neof,1/),rtsP) ; now draw as one plot
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160315/ed875d29/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eof.pdf
Type: application/pdf
Size: 249749 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160315/ed875d29/attachment-0001.pdf
More information about the ncl-talk
mailing list