Re: panel plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 1 Dec 2008 07:57:06 -0700 (MST)

Hi,

I am unable to reproduce this problem, and it doesn't look like
you are doing anything incorrect.

Is it possible for you to write the "nf4d" values to a netCDF file and
send me that file, so I can try running your script here? You can
write the NetCDF file with:

    fout = addfile("nf4d.nc","c")
    fout->nf4d= nf4d

If the file is too large to email, let me know and I'll provide a
place to put it.

--Mary

On Mon, 1 Dec 2008, [BIG5] 呂小雯 wrote:

> Dear NCL users:
> If I set res_at_gsnDraw=True, I can plot profile-graphic.
> When I use panel plot, my error message is
> warning:TextItemSetValues: Can not change x,y,width,and height when
> other text attribute changes have been requested also, preceding with
> other text attribute requests
> How to correct my code?
> Thanks in advance.
>
> Lolita
>
> load "/home/lolita/nclroot/contributed.ncl"
> load "/home/lolita/nclroot/gsn_code.ncl"
> load "/home/lolita/nclroot/gsn_csm.ncl"
> load "/home/lolita/nclroot/shea_util.ncl"
> ;************************************************
> begin
> ;************************************************
> ; read in data1 file for binary
> ;************************************************
> path_sfc= "/data1/lolita_data/JRA_relv/relv_sfc.pdr_qbw.12m"
> path_1000 = "/data1/lolita_data/JRA_relv/relv_1000mb.pdr_qbw.12m"
> path_925 = "/data1/lolita_data/JRA_relv/relv_925mb.pdr_qbw.12m"
> path_850 = "/data1/lolita_data/JRA_relv/relv_850mb.pdr_qbw.12m"
> path_700 = "/data1/lolita_data/JRA_relv/relv_700mb.pdr_qbw.12m"
> path_600 = "/data1/lolita_data/JRA_relv/relv_600mb.pdr_qbw.12m"
> path_500 = "/data1/lolita_data/JRA_relv/relv_500mb.pdr_qbw.12m"
> path_400 = "/data1/lolita_data/JRA_relv/relv_400mb.pdr_qbw.12m"
> path_300 = "/data1/lolita_data/JRA_relv/relv_300mb.pdr_qbw.12m"
> path_250 = "/data1/lolita_data/JRA_relv/relv_250mb.pdr_qbw.12m"
> path_200 = "/data1/lolita_data/JRA_relv/relv_200mb.pdr_qbw.12m"
> path_150 = "/data1/lolita_data/JRA_relv/relv_150mb.pdr_qbw.12m"
> path_100 = "/data1/lolita_data/JRA_relv/relv_100mb.pdr_qbw.12m"
> fname="out_jra_relv.pdr_qbw-profile"
> wks=gsn_open_wks("pdf",fname) ; open a pdf file
> nlat = 33
> mlon = 121
> nf4d = new((/13,12,33,121/),float)
>
> do nrec = 0, 11, 1
> nf_sfc = fbindirread(path_sfc, nrec, (/nlat,mlon/), "float")
> nf_1000 = fbindirread(path_1000, nrec, (/nlat,mlon/), "float")
> nf_925 = fbindirread(path_925, nrec, (/nlat,mlon/), "float")
> nf_850 = fbindirread(path_850, nrec, (/nlat,mlon/), "float")
> nf_700 = fbindirread(path_700, nrec, (/nlat,mlon/), "float")
> nf_600 = fbindirread(path_600, nrec, (/nlat,mlon/), "float")
> nf_500 = fbindirread(path_500, nrec, (/nlat,mlon/), "float")
> nf_400 = fbindirread(path_400, nrec, (/nlat,mlon/), "float")
> nf_300 = fbindirread(path_300, nrec, (/nlat,mlon/), "float")
> nf_250 = fbindirread(path_250, nrec, (/nlat,mlon/), "float")
> nf_200 = fbindirread(path_200, nrec, (/nlat,mlon/), "float")
> nf_150 = fbindirread(path_150, nrec, (/nlat,mlon/), "float")
> nf_100 = fbindirread(path_100, nrec, (/nlat,mlon/), "float")
> nf4d(0,nrec,:,:) = nf_sfc(:,:)
> nf4d(1,nrec,:,:) = nf_1000(:,:)
> nf4d(2,nrec,:,:) = nf_925(:,:)
> nf4d(3,nrec,:,:) = nf_850(:,:)
> nf4d(4,nrec,:,:) = nf_700(:,:)
> nf4d(5,nrec,:,:) = nf_600(:,:)
> nf4d(6,nrec,:,:) = nf_500(:,:)
> nf4d(7,nrec,:,:) = nf_400(:,:)
> nf4d(8,nrec,:,:) = nf_300(:,:)
> nf4d(9,nrec,:,:) = nf_250(:,:)
> nf4d(10,nrec,:,:) = nf_200(:,:)
> nf4d(11,nrec,:,:) = nf_150(:,:)
> nf4d(12,nrec,:,:) = nf_100(:,:)
> end do
>
> ;************************************************
> ; Create lon and lat coordinates variables
> ;************************************************
> lev = (/ 1013, 1000, 925, 850, 700, 600, 500, 400, 300, 250, 200, 150, 100 /)
> lev_at_units = "mb"
> lev_at_long_name = "pressure" ; attach some attributes
>
> month = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 /)
> month_at_units = "month"
> month_at_long_name = "month"
>
> lat = new(33,float)
> lat = fspan(0,40,33)
> lat_at_units = "degrees-north"
> lat_at_long_name = "latitude"
>
> lon = new(121,float)
> lon = fspan(60,210,121)
> lon_at_units = "degrees-east"
> lon_at_long_name = "longitude"
>
> month!0 = "month"
> month_at_long_name = "month"
> month_at_units = "month"
> month&month = month
>
> nf4d!0 = "lev"
> nf4d&lev = lev ; create coordinate variable
> nf4d!1 = "month"
> nf4d&month = month
> nf4d!2 = "lat" ; name dimensions
> nf4d&lat = lat
> nf4d!3 = "lon"
> nf4d&lon = lon
>
> ; printVarSummary(nf4d)
>
> ;************************************************
> ; create plot
> ;************************************************
> gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
>
> ;************************************************
> ; resource list for first data array
> ;************************************************
> res = True ; plot mods desired
> res_at_cnFillOn = True ; turn off color fill
> res_at_cnLinesOn = False ; turn on contour lines
> res_at_cnLineLabelsOn = False
> res_at_cnInfoLabelOn = False ; turn off info label
>
> res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
> res_at_cnMinLevelValF = 0.1 ; set min contour level
> res_at_cnMaxLevelValF = 0.5 ; set max contour level
> res_at_cnLevelSpacingF = 0.1 ; set contour spacing
> res_at_cnMissingValPerimOn = True ; turn on the
> missing value perimeter
>
> res_at_tiMainOn = True
> res_at_tiMainString = "JRA_relv"
>
> res_at_tmYRMode = "Automatic" ; turn off special
> labels on right axis
>
> res_at_gsnSpreadColors = True ; use full colormap
> res_at_gsnSpreadColorStart = 0 ; start at color
> res_at_gsnSpreadColorEnd = 95 ; end at color
>
> ; res_at_gsnDraw = False ; don't draw
> ; res_at_gsnFrame = False ; don't advance frame
> ; res_at_gsnMaximize = True ; maximize image
>
> res_at_lbOrientation = "Vertical" ; vertical label bar
> res_at_lbTitleFontHeightF = 0.02
> res_at_lbTitleOn = True ; turn on title
>
> mth = (/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"/)
> plot = new(12,graphic) ; create graphics array
>
> do i = 0,11,1
> res_at_lbTitleString = mth(i) ; plot title
> plot = gsn_csm_pres_hgt(wks,nf4d(:,i,{20},:),res)
> ; the "{}" allows you to use coordinate subscripting to select a particular
> ; latitude vice array indice of the latitude you want.
> end do
>
> ;*******************************************
> ; draw panel plot with title
> ;*******************************************
> pres = True ; mod panel plot
> pres_at_gsnFrame = False
> ; pres_at_gsnMaximize = True ; maximize plots
>
> pres_at_txString = "PROFILE" ; add common title
> pres_at_txFont = "helvetica-bold"
> pres_at_txFontHeightF = 0.015 ; font size
>
> gsn_panel(wks,plot(0:3),(/4,1/),pres) ; now draw as one plot
> frame(wks)
> gsn_panel(wks,plot(4:7),(/4,1/),pres)
> frame(wks)
> gsn_panel(wks,plot(8:11),(/4,1/),pres)
> frame(wks)
>
> end
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Dec 01 2008 - 07:57:06 MST

This archive was generated by hypermail 2.2.0 : Mon Dec 01 2008 - 08:44:47 MST