<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Tabish,<br>
<br>
gsn_panel draw the panel and advance the frame per default. You have
to add<br>
<br>
resP@gsnFrame = False<br>
<br>
to the panel resources.<br>
<br>
-Karin<br>
<br>
<div class="moz-cite-prefix">Am 24.04.18 um 00:50 schrieb Tabish
Ansari:<br>
</div>
<blockquote type="cite"
cite="mid:CALLVTytxrHA+MeMc8B3SbsBR8RWQnfarNPd6uBQuxAp7rrf3+g@mail.gmail.com">
<div dir="ltr">
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">Hi<br>
<br>
</div>
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">I'm trying to add some text below the common
labelbar of my panelplot as suggested in: <a
href="https://www.ncl.ucar.edu/Applications/Scripts/panel_4.ncl"
moz-do-not-send="true">https://www.ncl.ucar.edu/Applications/Scripts/panel_4.ncl</a><br>
<br>
</div>
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">However, it is being printed on a new empty
frame.<br>
<br>
</div>
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">Here's my script:<br>
<br>
<font size="1"><i>load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load
"$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" ;
Add special wrf functions<br>
<br>
begin<br>
<br>
a = addfile("/home/tabish/WPS_Nishadh/<a
href="http://geo_em.d01_3km.nc" moz-do-not-send="true">geo_em.d01_3km.nc</a>","r")
; Open a file<br>
b = addfile("/home/tabish/WPS/<a
href="http://geo_em.d03.nc" moz-do-not-send="true">geo_em.d03.nc</a>","r")
; Open a file<br>
c = addfile("/home/tabish/WPS_Nishadh/<a
href="http://geo_em.d04_1km.nc" moz-do-not-send="true">geo_em.d04_1km.nc</a>","r")
; Open a file<br>
z1 =
asciiread("/data1/tabish/nclscripts/metstations_D01",-1,"string")<br>
z2 =
asciiread("/data1/tabish/nclscripts/surfacedata_12-31_Octmean_improved.txt",-1,"string")<br>
LATmet = stringtofloat(str_get_cols(z1, 36,42))<br>
LONmet = stringtofloat(str_get_cols(z1, 45,52))<br>
print (LATmet +" "+LONmet)<br>
<br>
LATpol = stringtofloat(str_get_cols(z2, 45,50))<br>
LONpol = stringtofloat(str_get_cols(z2, 27,33))<br>
print("LAT/LON for polstations")<br>
print (LATpol +" "+LONpol)<br>
<br>
type = "x11"<br>
wks =
gsn_open_wks(type,"ter_d01_met-pol_stations") ;
Create a plot workstation<br>
setvalues NhlGetWorkspaceObjectId()<br>
"wsMaximumSize" : 300000000<br>
end setvalues<br>
gsn_define_colormap(wks,"OceanLakeLandSnow")<br>
<br>
opts = True ; Set some
Basic Plot options<br>
opts@MainTitle = "GEOGRID FIELDS"<br>
opts@NoHeaderFooter = True<br>
ter_d01 = a->HGT_M(0,:,:) ; Read
the variable to memory<br>
ter_d03 = b->HGT_M(0,:,:) ; Read
the variable to memory<br>
ter_d04 = c->HGT_M(0,:,:) ; Read
the variable to memory<br>
ter_d01@description = ""<br>
ter_d01@units = ""<br>
ter_d03@description = ""<br>
ter_d03@units = ""<br>
ter_d04@description = ""<br>
ter_d04@units = ""<br>
res = opts ; Use basic
options for this field<br>
res@cnFillOn = True ; Create a
color fill plot<br>
res@cnFillMode = "RasterFill" ; Raster Mode<br>
res@lbLabelBarOn = False ; turn off
individual cb's<br>
res@gsnDraw = False ; don't draw<br>
res@gsnFrame = False ; don't
advance frame<br>
<br>
res@cnLevelSelectionMode = "ExplicitLevels" ; set
explicit contour levels<br>
res@cnLevels = (/
1,5,10,50,100,150,200,250,300,400,500,700,1000,1200,1500,1800,2500,3000,4000/)<br>
contour_d01 = wrf_contour(a,wks,ter_d01,res)<br>
contour_d03 = wrf_contour(b,wks,ter_d03,res)<br>
res@cnFillMode = "AreaFill" ; Raster Mode
switched off the d04<br>
contour_d04 = wrf_contour(c,wks,ter_d04,res)<br>
<br>
pltres = True ; Set plot
options<br>
mpres = True ; Set map
options<br>
mpres@mpDataBaseVersion = "MediumRes"<br>
mpres@mpDataSetName = "Earth..4"<br>
mpres@mpGeophysicalLineColor = "Black"<br>
mpres@mpGridLineColor = "Black"<br>
mpres@mpLimbLineColor = "Black"<br>
mpres@mpNationalLineColor = "Black"<br>
mpres@mpPerimLineColor = "Black"<br>
mpres@mpUSStateLineColor = "Black"<br>
mpres@mpOutlineBoundarySets = "AllBoundaries"<br>
mpres@mpNationalLineThicknessF = 1.5<br>
mpres@mpProvincialLineThicknessF = 1.5<br>
mpres@mpGeophysicalLineThicknessF = 1.5<br>
<br>
pltres@PanelPlot = True ; Indicate these plots are to
be paneled.<br>
pltres@NoHeaderFooter = True<br>
pltres@FramePlot = False ; do not frame plot - will do
this manually later<br>
<br>
plot = new(3,graphic) ; create a
plot array<br>
plot(0) =
wrf_map_overlays(a,wks,(/contour_d01/),pltres,mpres) ;
Plot the data over a map background<br>
plot(1) =
wrf_map_overlays(b,wks,(/contour_d03/),pltres,False) ;
Plot the data over a map background<br>
plot(2) =
wrf_map_overlays(c,wks,(/contour_d04/),pltres,False) ;
Plot the data over a map background<br>
<br>
;---Attach some dummy text strings<br>
txres = True<br>
txres@txFontHeightF = 0.017<br>
txres@txJust = "TopCenter"<br>
<br>
gres2 = True<br>
gres2@gsFillColor = "deepskyblue"<br>
gres2@gsFillOpacityF = 0.7<br>
lat2 = (/35.04059, 45.21748, 44.41343, 34.32753,
35.04059/)<br>
lon2 = (/109.437, 109.3554, 124.9451, 123.0779,
109.437/)<br>
tabish1 = gsn_add_polygon(wks,plot(0),lon2,lat2,gres2)<br>
<br>
<br>
gres3 = True<br>
gres3@gsFillColor = "pink"<br>
gres3@gsFillOpacityF = 0.7<br>
lat3 = (/36.05806, 42.79478, 42.4514, 35.7411,
36.05806/)<br>
lon3 = (/113.3356, 113.6442, 120.2533, 119.3942,
113.3356/)<br>
tabish2 = gsn_add_polygon(wks,plot(0),lon3,lat3,gres3)<br>
<br>
pmres1 = True<br>
pmres1@gsMarkerColor = "Blue"<br>
pmres1@gsMarkerIndex = 16<br>
pmres1@gsMarkerSizeF = 0.002<br>
<br>
pmres2 = True<br>
pmres2@gsMarkerColor = "Red"<br>
pmres2@gsMarkerIndex = 16<br>
pmres2@gsMarkerSizeF = 0.002<br>
;STARTING TO MARK MET AND POL STATIONS<br>
tabish3 =
gsn_add_polymarker(wks,plot(0),LONmet,LATmet,pmres1)<br>
tabish4 =
gsn_add_polymarker(wks,plot(0),LONpol,LATpol,pmres2)<br>
<br>
pmres1@gsMarkerSizeF = 0.003<br>
pmres2@gsMarkerSizeF = 0.003<br>
tabish5 =
gsn_add_polymarker(wks,plot(1),LONmet,LATmet,pmres1)<br>
tabish6 =
gsn_add_polymarker(wks,plot(1),LONpol,LATpol,pmres2)<br>
<br>
pmres1@gsMarkerSizeF = 0.006<br>
pmres2@gsMarkerSizeF = 0.006<br>
tabish7 =
gsn_add_polymarker(wks,plot(2),LONmet,LATmet,pmres1)<br>
tabish8 =
gsn_add_polymarker(wks,plot(2),LONpol,LATpol,pmres2)<br>
pmres2@gsMarkerColor = "Black"<br>
tabish9 =
gsn_add_polymarker(wks,plot(2),116.37,39.97,pmres2)<br>
<br>
china_shp_name =
"/data1/tabish/Shapefiles/China/CHN_adm1.shp"<br>
lnres = True<br>
lnres@gsLineColor = "black"<br>
lnres@gsLineThicknessF = 1<br>
;china_id1 =
gsn_add_shapefile_polylines(wks,plot(0),china_shp_name,lnres)<br>
china_id3 =
gsn_add_shapefile_polylines(wks,plot(1),china_shp_name,lnres)<br>
china_id4 =
gsn_add_shapefile_polylines(wks,plot(2),china_shp_name,lnres)<br>
<br>
;************************************************<br>
; create panel<br>
;************************************************<br>
resP = True ; modify
the panel plot<br>
resP@gsnPanelMainString = "Model domain: topography,
meteorological and pollutant stations"<br>
resP@gsnPanelLabelBar = True ; This
gives an error!!!<br>
resP@lbLabelFontHeightF = 0.007 ; make
labels smaller<br>
resP@gsnPanelRowSpec = True ; tell
panel what order to plot<br>
resP@gsnPanelCenter = False<br>
resP@gsnPanelBottom = 0.07<br>
; resP@FramePlot = False ; do not frame plot - will do
this manually later<br>
gsn_panel(wks,(/plot/),(/2,1/),resP) ; now
draw as one plot<br>
<br>
<br>
; Draw a text string at the bottom<br>
txres = True<br>
txres@txFontHeightF = 0.015<br>
txres@FramePlot = False ; do not frame plot - will do
this manually later<br>
gsn_text_ndc(wks,"Topography height (m)",0.5,0.02,txres)<br>
frame(wks)<br>
end</i></font><br>
<br>
</div>
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">Please help me resolve this issue.<br>
<br>
</div>
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">Thanks very much,<br>
<br>
</div>
<div class="gmail_default" style="font-family:trebuchet
ms,sans-serif">Tabish<br>
<br clear="all">
</div>
<div>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div><font size="1"><span
style="font-family:tahoma,sans-serif">Tabish U
Ansari<br>
</span></font></div>
<font size="1"><span
style="font-family:tahoma,sans-serif">PhD student,
Lancaster Environment Center<br>
</span></font></div>
<font size="1"><span style="font-family:tahoma,sans-serif">Lancaster
Univeristy<br>
<span>Bailrigg</span>, <span>Lancaster</span>, <br>
<span>LA1 4YW</span>, <span>United Kingdom</span></span></font><br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
</body>
</html>