<div dir="ltr">When making panel plots, NCL uses the contour settings from the first panel for the color bar. It makes an assumption that you have explicitly set the cnLevelSelectionMode and appropriate resources (either cnLevels or cnMinLevelF/cnMaxLevelF/cnLevelSpacingF) to ensure this consistency between each panel.<div><br></div><div>I would suggest manually settings some of these contour level resources to make your plots consistent and this should fix your problem.<div><br></div><div><br></div><div>Kyle</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Mar 20, 2016 at 11:03 PM Adv <<a href="mailto:advita6@gmail.com">advita6@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br></div><div>In second and third spatial plots, cn labels are not consistent with lb label bar. There is a shift. I have attached here a figure for your review.<br></div>Could someone help me to resolve this issue?<br><br></div>Thank you<br><div><br>;**************************************************<br>; plot parameters<br>;**************************************************<br><br>wks = gsn_open_wks("pdf","eof")<br> gsn_define_colormap(wks,"BlWhRe") ; choose colormap<br>; gsn_define_colormap(wks,"testcmap") ; choose colormap<br> plot = new(neof,graphic) ; create graphic array<br> ; only needed if paneling<br>; EOF patterns<br><br> res = True<br> res@gsnDraw = False ; don't draw yet<br> res@gsnFrame = False ; don't advance frame yet<br><br>;---This resource not needed in V6.1.0<br> res@gsnSpreadColors = True ; spread out color table<br><br> res@gsnAddCyclic = False ; plotted dataa are not cyclic<br><br> res@mpFillOn = False ; turn off map fill<br> res@mpMinLatF = eof&lat(0) ; zoom in on map<br> res@mpMaxLatF = eof&lat(nlat-1)<br>res@mpMinLonF = eof&lon(0)<br> res@mpMaxLonF = eof&lon(mlon-1)<br> res@cnFillOn = True ; turn on color fill<br> res@cnLinesOn = True ; True is default<br>;res@cnLineLabelsOn = False<br> res@lbLabelBarOn = False ; turn off individual lb's<br>res@mpGeophysicalLineThicknessF = 3.0<br>res@mpGeophysicalLineColor = "Black"; (/22/)<br>res@mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state boundaries<br>res@mpNationalLineColor = res@mpGeophysicalLineColor<br>res@mpUSStateLineThicknessF = 3.0<br>res@mpUSStateLineColor = res@mpGeophysicalLineColor<br><br><br> ; set symmetric plot min/max<br>; symMinMaxPlt(eof, 16, False, res) ; contributed.ncl<br><br>; panel plot only resources<br> resP = True ; modify the panel plot<br> resP@gsnMaximize = True ; large format<br> resP@gsnPanelLabelBar = True ; add common colorbar<br>resP@lbLabelAutoStride = True ; auto stride on labels<br><br> yStrt = yyyymm(0)/100<br> yLast = yyyymm(nyrs-1)/100<br> resP@txString = "Reanalysis_Temp(C) DJF EOF: "+season+": "+yStrt+"-"+yLast<br><br>;*******************************************<br>; first plot<br>;*******************************************<br> do n=0,neof-1<br> res@gsnLeftString = "EOF "+(n+1)<br> res@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"<br> plot(n)=gsn_csm_contour_map_ce(wks,eof(n,:,:),res)<br> end do<br> gsn_panel(wks,plot,(/neof,1/),resP) ; now draw as one plot<br>; txres = True<br>; txres@txFontHeightF = 0.015<br>; gsn_text_ndc(wks,"Figure 16: A smaller panel plot",0.5,0.16,txres)<br> frame(wks)<br>;*******************************************<br>; second plot<br>;*******************************************<br>; EOF time series [bar form]<br><br> rts = True<br> rts@gsnDraw = False ; don't draw yet<br> rts@gsnFrame = False ; don't advance frame yet<br> rts@gsnScale = True ; force text scaling<br><br>; these four rtsources allow the user to stretch the plot size, and<br>; decide exactly where on the page to draw it.<br><br> rts@vpHeightF = 0.40 ; Changes the aspect ratio<br> rts@vpWidthF = 0.85<br> rts@vpXF = 0.10 ; change start locations<br> rts@vpYF = 0.75 ; the plot<br><br><br> rts@tiYAxisString = "deg C" ; y-axis label<br> rts@gsnYRefLine = 0. ; reference line<br> rts@gsnXYBarChart = True ; create bar chart<br> rts@gsnAboveYRefLineColor = "red" ; above ref line fill red<br> rts@gsnBelowYRefLineColor = "blue" ; below ref line fill blue<br><br>; panel plot only resources<br> rtsP = True ; modify the panel plot<br> rtsP@gsnMaximize = True ; large format<br> rtsP@txString = "Reanalysis_Temp(C) DJF EOF "+season+": "+yStrt+"-"+yLast<br><br> year = yyyymm/100<br><br>; create individual plots<br> do n=0,neof-1<br> rts@gsnLeftString = "EOF "+(n+1)<br> rts@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"<br> plot(n) = gsn_csm_xy (wks,year+0,eof_ts(n,:),rts)<br> end do<br> gsn_panel(wks,plot,(/neof,1/),rtsP) ; now draw as one plot<br><br>end<br><br></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>