Re: Plot layout

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 20 Oct 2006 15:42:59 -0600

Hi Nilesh,

When paneling, it is usually best to set gsnMaximize in your panel
resource list, and not in the individual plot's resource list...

So comment out:
res_at_gsnMaximize = True
and put in:
resP_at_gsnMaximize = True

That will likely solve the issue. If not, let us know...
Adam

araligin_at_onid.orst.edu wrote:
> Hi,
>
> I have a problem while plotting the figure. I have used
> "gsnMaximize ", but still the color label bar goes out of the page. I don'nt
> know where I am going wrong. I have attached the code and the fig.
>
> Thanking you,
> Nilesh
>
>
> ------------------------------------------------------------------------
>
> load "/home/server/student/homes/naraligi/contributed/gsn_code.ncl"
> load "/home/server/student/homes/naraligi/contributed/gsn_csm.ncl"
> load "/home/server/student/homes/naraligi/contributed/shea_util.ncl"
> load "/home/server/student/homes/naraligi/contributed/contributed.ncl"
>
>
> begin
>
> rnfile = "~/research/filter/rn.nc"
> wspfile = "~/research/qkscat/q_filt.nc"
> wspfile2 = "~/research/qkscat/qscat.150130.int.nc"
>
> wfile = addfile(wspfile,"r")
> wfile2 = addfile(wspfile2,"r")
> rfile = addfile(rnfile, "r")
> time = rfile->time(365:2921)
> time_at_units = "days since 0-1-1 00:00:0.0"
> lat1=rfile->lon
> print(lat1(130:208))
> ymd = ut_calendar(time,0)
> mon=ymd(:,1)
> ; print(mon)
> i = ind(mon.eq.11 .or. mon.eq.12 .or. \
> mon.eq.1 .or. mon.eq. 2 .or. mon.eq.3 .or. mon.eq.4)
> ; i = ind(mon.eq.11 .or. mon.eq.12 .or. \
> ; mon.eq.1)
> j = ind(mon.eq.5 .or. mon.eq.6 .or. mon.eq.7.or. \
> mon.eq.8 .or. mon.eq.9 .or. mon.eq.10)
> ; j = ind( mon.eq.5 .or. mon.eq.6.or. \
> ; mon.eq.7)
>
> print("done")
> rn = rfile->rain(365:2921,35:63,130:208)
> rain_nsum = rn(j,:,:)
> rain_ssum = rn(i,:,:)
> print("read the first one")
> print(dimsizes(rn))
> wspd_nsum = wfile->wsp(j,:,:)
> print("read the second one")
> wspd_ssum = wfile->wsp(i,:,:)
> print(max(wspd_ssum))
> print(max(wspd_nsum))
> print(dimsizes(wspd_ssum))
> print(dimsizes(wspd_nsum))
> unsum = wfile2->u(j,:,:)
> vnsum = wfile2->v(j,:,:)
> ussum = wfile2->u(i,:,:)
> vssum = wfile2->v(i,:,:)
> lat = unsum&lat
> lon = unsum&lon
> print("reading done")
>
>
> mnu_nsum = dim_avg(unsum(lat|:,lon|:,time|:))
> mnu_ssum = dim_avg(ussum(lat|:,lon|:,time|:))
> mnv_nsum = dim_avg(vnsum(lat|:,lon|:,time|:))
> mnv_ssum = dim_avg(vssum(lat|:,lon|:,time|:))
> stddevws_nsum = dim_stddev( wspd_nsum(lat|:,lon|:,time|:))
> stddevws_ssum = dim_stddev( wspd_ssum(lat|:,lon|:,time|:))
> stddevrn_nsum = dim_stddev( rain_nsum(lat|:,lon|:,time|:))
> stddevrn_ssum = dim_stddev( rain_ssum(lat|:,lon|:,time|:))
>
> print(dimsizes(wspd_ssum))
> print(dimsizes(rain_ssum))
> ccf_ssum = escovc(wspd_ssum(lat|:,lon|:,time|:),rain_ssum(lat|:,lon|:,time|:))/(stddevws_ssum*stddevrn_ssum)
> print("Done with one ccoef")
> ccf_nsum = escovc(wspd_nsum(lat|:,lon|:,time|:),rain_nsum(lat|:,lon|:,time|:))/(stddevws_nsum*stddevrn_nsum)
> print(dimsizes(ccf_nsum))
> ccf_nsum!0= "lat"
> ccf_ssum!0= "lat"
> mnu_ssum!0= "lat"
> mnu_nsum!0= "lat"
> mnv_ssum!0= "lat"
> mnv_nsum!0= "lat"
> ccf_nsum!1= "lon"
> ccf_ssum!1= "lon"
> mnu_ssum!1= "lon"
> mnu_nsum!1= "lon"
> mnv_ssum!1= "lon"
> mnv_nsum!1= "lon"
> ccf_nsum&lat = lat
> ccf_ssum&lat = lat
> mnu_ssum&lat = lat
> mnu_nsum&lat = lat
> mnv_ssum&lat = lat
> mnv_nsum&lat = lat
> ccf_nsum&lon = lon
> ccf_ssum&lon = lon
> mnu_ssum&lon = lon
> mnu_nsum&lon = lon
> mnv_ssum&lon = lon
> mnv_nsum&lon = lon
> print("Calculations done")
> ;==================================================================================
> wks = gsn_open_wks("ps","ccwsrn_flt")
> gsn_define_colormap(wks,"gui_default")
> plot = new(2,graphic)
>
> res = True
> res_at_mpProjection = "Mercator"
> res_at_mpPerimOn = True
> res_at_mpFillOn = True
> res_at_mpCenterLonF = 180
> res_at_mpLandFillColor = "black"
>
> res_at_gsnFrame = False
> res_at_gsnDraw = False
> res_at_gsnScalarContour = True
>
> res_at_cnFillOn = True
> res_at_cnLineLabelsOn = False
> res_at_cnLinesOn = False
> res_at_lbLabelBarOn = False
> res_at_lbLabelFontAspectF = 0.5
>
>
> res_at_mpLimitMode = "LatLon"
> res_at_mpMinLatF = -15
> res_at_mpMaxLatF = 15
> res_at_mpMinLonF = 130
> res_at_mpMaxLonF = 210
>
>
> res_at_pmTickMarkDisplayMode = "Always"
>
> res_at_gsnAddCyclic = False
> res_at_gsnSpreadColors = True
>
> res_at_txFontHeightF = 0.008
> res_at_vcRefAnnoArrowLineColor = "black" ; change ref vector color
> res_at_vcRefAnnoArrowUseVecColor = False ; don't use vec color for ref
>
> res_at_vcLineArrowColor = "black" ; change vector color
> res_at_vcLineArrowThicknessF = 1.0 ; change vector thickness
> res_at_vcFillArrowFillColor = "black"
> res_at_vcGlyphStyle = "LineArrow"
> res_at_vcRefLengthF = 0.035
> res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
> res_at_cnMinLevelValF = -0.3 ; set min contour level
> res_at_cnMaxLevelValF = 0.8 ; set max contour level
> res_at_cnLevelSpacingF = 0.05 ; set contour spacing
>
> res_at_gsnMaximize = True
>
> plot(0) = gsn_csm_vector_scalar_map(wks,mnu_nsum,mnv_nsum,ccf_nsum,res)
> plot(1) = gsn_csm_vector_scalar_map(wks,mnu_ssum,mnv_ssum,ccf_ssum,res)
>
>
> resP = True
> resP_at_gsnPanelLabelBar = True ; add common colorbar
> resP_at_txString = "Correlation coefficient "
> resP_at_lbLabelFontHeightF = 0.01
> gsn_panel(wks,plot,(/2,1/),resP)
>
>
>
>
> end
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Oct 20 2006 - 15:42:59 MDT

This archive was generated by hypermail 2.2.0 : Sat Oct 21 2006 - 07:36:59 MDT