[ncl-talk] how to overlay station wind vector on a grid map with panel style?

Mary Haley haley at ucar.edu
Mon Nov 7 22:15:45 MST 2016


As I mentioned in my previous message, the wmbarb/wmbarbmap routines are
pretty primitive. They cannot be attached to plots like text, markers,
lines, and polygons can.

Instead of using gsn_panel, you need to set vpXF, vpYF, vpWidthF and
vpHeightF for each plot yourself, so you can control where it gets drawn on
the page. You must draw the wind barbs for the current plot before you draw
the next plot.

You can use your current gsn_panel code to help you determine the values of
these resources, by setting the special gsnPanelDebug resource to True.

See example panel_39.ncl at:

http://www.ncl.ucar.edu/Applications/panel.shtml#ex39

You may also want to see example weather_sym_5.ncl at:

http://www.ncl.ucar.edu/Applications/weather_sym.shtml

which is drawing wind barbs on paneled plots.

Good luck,

--Mary


On Sun, Nov 6, 2016 at 5:33 AM, dyjbean at gmail.com <dyjbean at gmail.com> wrote:

> hi.
>    when i want to plot station wind barb with gsn_panel style, i found it
>  difficult to overlay wmvectmap on individual figure with panel,
> i have tried some methods , such as put the wmvectmap front or behind the
> gsn_panel or every independent subplot, but they didn't work.
>
> the following is my script,
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> load "./shapefile_mask_data.ncl"
> ;load "$GEODIAG_ROOT/geodiag.ncl"
>
> begin
> shp_fname="jjj.shp"
> create_mask=True
>
> minlon = 113.40
> maxlon = 119.90
> minlat = 36.00
> maxlat = 42.70
>
> add_latlon_points        = False
> add_shapefile_outlines  = True
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; uv data
> bj_csvs1=systemfunc("ls uvdata/112920_inside_jingjinji_obs.csv")
>
> lines1=asciiread(bj_csvs1,-1,"string")
> nlines1=dimsizes(lines1) - 1
>
> delim1=","
> field_names1=str_split(lines1(0),delim1)
> nfields1=dimsizes(field_names1)
>
> ;
> fields1=new((/nfields1,nlines1/),string)
> do nf=0,nfields1-1
>   fields1(nf,:)=str_get_field(lines1(1:),nf+1,delim1)
> end do
>
> ;print(fields(1,:) + "   "+fields(2,:) + "   "+tofloat(
> fields(3,:))*2.5+"   "+tofloat(fields(4,:))*2.5)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> bj_csvs2=systemfunc("ls uvdata/113008_inside_jingjinji_obs.csv")
>
> lines2=asciiread(bj_csvs2,-1,"string")
> nlines2=dimsizes(lines2) - 1
>
> delim2=","
> field_names2=str_split(lines2(0),delim2)
> nfields2=dimsizes(field_names2)
>
> ;
> fields2=new((/nfields2,nlines2/),string)
> do nf=0,nfields2-1
>   fields2(nf,:)=str_get_field(lines2(1:),nf+1,delim2)
> end do
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> bj_csvs3=systemfunc("ls uvdata/113014_inside_jingjinji_obs.csv")
>
> lines3=asciiread(bj_csvs3,-1,"string")
> nlines3=dimsizes(lines3) - 1
>
> delim3=","
> field_names3=str_split(lines3(0),delim3)
> nfields3=dimsizes(field_names3)
>
> ;
> fields3=new((/nfields3,nlines3/),string)
> do nf=0,nfields3-1
>   fields3(nf,:)=str_get_field(lines3(1:),nf+1,delim3)
> end do
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> bj_csvs4=systemfunc("ls uvdata/113020_inside_jingjinji_obs.csv")
>
> lines4=asciiread(bj_csvs4,-1,"string")
> nlines4=dimsizes(lines4) - 1
>
> delim4=","
> field_names4=str_split(lines4(0),delim4)
> nfields4=dimsizes(field_names4)
>
> ;
> fields4=new((/nfields4,nlines4/),string)
> do nf=0,nfields4-1
>   fields4(nf,:)=str_get_field(lines4(1:),nf+1,delim4)
> end do
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; pm2.5 data
>
>   ncol = 3                                ; number of
> columns is 3£»ÄãµÄÁÐÊý
>   stationdata1= readAsciiTable("pm2.5_txt/15112920.txt", ncol, "float", 1)
>   stationdata2= readAsciiTable("pm2.5_txt/15113008.txt", ncol, "float", 1)
>   stationdata3= readAsciiTable("pm2.5_txt/15113014.txt", ncol, "float", 1)
>   stationdata4= readAsciiTable("pm2.5_txt/15113020.txt", ncol, "float", 1)
>
>   ; print(dimsizes(stationdata1))
>   nps1  =dimsizes(stationdata1)
>   npts1 = nps1(0)            ; Number of points.
>
>   nps2  =dimsizes(stationdata2)
>   npts2 = nps2(0)            ; Number of points.
>
>   nps3  =dimsizes(stationdata3)
>   npts3 = nps3(0)            ; Number of points.
>
>   nps4  =dimsizes(stationdata4)
>   npts4 = nps4(0)            ; Number of points.
>
>   lat1 = stationdata1(:,1)     ; latitude values
>   lon1 = stationdata1(:,0)     ; longitude values
>   pm251= stationdata1(:,2)   ; station numbers to appear on
> the map£»Õâ¸öµØ·½Äã¿ÉÒÔдÎÛȾÊý¾Ý
>
>   lat2 = stationdata2(:,1)     ; latitude values
>   lon2 = stationdata2(:,0)     ; longitude values
>   pm252= stationdata2(:,2)   ; station numbers to appear on
> the map£»Õâ¸öµØ·½Äã¿ÉÒÔдÎÛȾÊý¾Ý
>
>   lat3 = stationdata3(:,1)     ; latitude values
>   lon3 = stationdata3(:,0)     ; longitude values
>   pm253= stationdata3(:,2)   ; station numbers to appear on
> the map£»Õâ¸öµØ·½Äã¿ÉÒÔдÎÛȾÊý¾Ý
>
>   lat4 = stationdata4(:,1)     ; latitude values
>   lon4 = stationdata4(:,0)     ; longitude values
>   pm254= stationdata4(:,2)   ; station numbers to appear on
> the map£»Õâ¸öµØ·½Äã¿ÉÒÔдÎÛȾÊý¾Ý
>
>   ; printMinMax(pm251,0)
> ;-------interpolate-----------------------------------------------------
>   olon1 =new(80,"float")
>   olat1 =new(80,"float")
>   data1=new((/80,80/),"float")
>   do j=0,79
>     olon1(j)=113+j*0.1
>   end do
>   do k=0,79
>     olat1(k)=36+k*0.1
>   end do
>
>   olon2 =new(80,"float")
>   olat2 =new(80,"float")
>   data2=new((/80,80/),"float")
>   do j=0,79
>     olon2(j)=113+j*0.1
>   end do
>   do k=0,79
>     olat2(k)=36+k*0.1
>   end do
>
>   olon3 =new(80,"float")
>   olat3 =new(80,"float")
>   data3=new((/80,80/),"float")
>   do j=0,79
>     olon3(j)=113+j*0.1
>   end do
>   do k=0,79
>     olat3(k)=36+k*0.1
>   end do
>
>   olon4 =new(80,"float")
>   olat4 =new(80,"float")
>   data4=new((/80,80/),"float")
>   do j=0,79
>     olon4(j)=113+j*0.1
>   end do
>   do k=0,79
>     olat4(k)=36+k*0.1
>   end do
>
> ;---------set interpolate res--------------------------------------------
>   olon1!0        ="lon"
>   olon1 at long_name="lontitude"
>   olon1 at units    ="degrees-east"
>   olon1&lon      =olon1
>
>   olat1!0        ="lat"
>   olat1 at long_name="latitude"
>   olat1 at units    ="degrees-north"
>   olat1&lat      =olat1
>
>   olon2!0        ="lon"
>   olon2 at long_name="lontitude"
>   olon2 at units    ="degrees-east"
>   olon2&lon      =olon2
>
>   olat2!0        ="lat"
>   olat2 at long_name="latitude"
>   olat2 at units    ="degrees-north"
>   olat2&lat      =olat2
>
>
>   olon3!0        ="lon"
>   olon3 at long_name="lontitude"
>   olon3 at units    ="degrees-east"
>   olon3&lon      =olon3
>
>   olat3!0        ="lat"
>   olat3 at long_name="latitude"
>   olat3 at units    ="degrees-north"
>   olat3&lat      =olat3
>
>   olon4!0        ="lon"
>   olon4 at long_name="lontitude"
>   olon4 at units    ="degrees-east"
>   olon4&lon      =olon4
>
>   olat4!0        ="lat"
>   olat4 at long_name="latitude"
>   olat4 at units    ="degrees-north"
>   olat4&lat      =olat4
>
> ;--------Call interpolation function--------------------------------------
>   ;pm25 at _FillValue=999999.000000
>   rscan=(/10,5,3,2,1,0.5,0.2,0.1/)
>   data1=obj_anal_ic_deprecated(lon1, lat1, pm251,
> olon1, olat1, rscan, False);creanm
>   data2=obj_anal_ic_deprecated(lon2, lat2, pm252,
> olon2, olat2, rscan, False);creanm
>   data3=obj_anal_ic_deprecated(lon3, lat3, pm253,
> olon3, olat3, rscan, False);creanm
>   data4=obj_anal_ic_deprecated(lon4, lat4, pm254,
> olon4, olat4, rscan, False);creanm
>   printMinMax(data1 ,0)
>   data1!0="lat"
>   data1!1="lon"
>   data1&lat=olat1
>   data1&lon=olon1
>   data1 at units=""
>   data1 at long_name="pm2.5"
>   ;data1 at _FillValue = pm25 at _FillValue
>   printMinMax(olat1,0)
>   printMinMax(olon1, 0)
>
>   data2!0="lat"
>   data2!1="lon"
>   data2&lat=olat2
>   data2&lon=olon2
>   data2 at units=""
>   data2 at long_name="pm2.5"
>   ;data1 at _FillValue = pm25 at _FillValue
>   printMinMax(olat2,0)
>   printMinMax(olon2, 0)
>
>   data3!0="lat"
>   data3!1="lon"
>   data3&lat=olat3
>   data3&lon=olon3
>   data3 at units=""
>   data3 at long_name="pm2.5"
>   ;data1 at _FillValue = pm25 at _FillValue
>   printMinMax(olat3,0)
>   printMinMax(olon3, 0)
>
>   data4!0="lat"
>   data4!1="lon"
>   data4&lat=olat4
>   data4&lon=olon4
>   data4 at units=""
>   data4 at long_name="pm2.5"
>   ;data1 at _FillValue = pm25 at _FillValue
>   printMinMax(olat4,0)
>   printMinMax(olon4, 0)
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> mask_fname1="15112920_mask.nc"
> if(create_mask) then
>     print("create the mask file:  ")
>
> ;---Create a new mask using a shapefile of Henan
>      udims1 = dimsizes(data1)
>      opt1             = True
>      opt1 at return_mask = True
> ;    opt1 at debug       = True
>      opt1 at minlon      = minlon     ; Makes the shapefile masking
>      opt1 at maxlon      = maxlon     ; go faster.
>      opt1 at minlat      = minlat
>      opt1 at maxlat      = maxlat
>      jjj_mask1        = shapefile_mask_data(data1({
> minlat:maxlat},{minlon:maxlon}),shp_fname,opt1)
>
> ;---Write new mask to file
>      system("rm -f " + mask_fname1)
>      fout1           = addfile(mask_fname1,"c")
>      fout1->jjj_mask1  = jjj_mask1
>    else
>      print("Reading mask off file.")
>
> ;---Read the new mask from the NetCDF file
>      fmask1    = addfile(mask_fname1,"r")
>      jjj_mask1  = fmask->jjj_mask1
>   end if
>
>    umask_data1 = where(jjj_mask1.eq.1,data1({minlat:
> maxlat},{minlon:maxlon}),data1 at _FillValue)
>    copy_VarMeta(data1({minlat:maxlat},{minlon:maxlon}),umask_data1)
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> mask_fname2="15113008_mask.nc"
> if(create_mask) then
>     print("create the mask file:  ")
>
> ;---Create a new mask using a shapefile of Henan
>      udims2 = dimsizes(data2)
>      opt2             = True
>      opt2 at return_mask = True
> ;    opt2 at debug       = True
>      opt2 at minlon      = minlon     ; Makes the shapefile masking
>      opt2 at maxlon      = maxlon     ; go faster.
>      opt2 at minlat      = minlat
>      opt2 at maxlat      = maxlat
>      jjj_mask2        = shapefile_mask_data(data2({
> minlat:maxlat},{minlon:maxlon}),shp_fname,opt2)
>
> ;---Write new mask to file
>      system("rm -f " + mask_fname2)
>      fout2           = addfile(mask_fname2,"c")
>      fout2->jjj_mask2  = jjj_mask2
>    else
>      print("Reading mask off file.")
>
> ;---Read the new mask from the NetCDF file
>      fmask2    = addfile(mask_fname2,"r")
>      jjj_mask2  = fmask2->jjj_mask2
>   end if
>
>    umask_data2 = where(jjj_mask2.eq.1,data2({minlat:
> maxlat},{minlon:maxlon}),data2 at _FillValue)
>    copy_VarMeta(data2({minlat:maxlat},{minlon:maxlon}),umask_data2)
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> mask_fname3="15113014_mask.nc"
> if(create_mask) then
>     print("create the mask file:  ")
>
> ;---Create a new mask using a shapefile of Henan
>      udims3 = dimsizes(data3)
>      opt3             = True
>      opt3 at return_mask = True
> ;    opt3 at debug       = True
>      opt3 at minlon      = minlon     ; Makes the shapefile masking
>      opt3 at maxlon      = maxlon     ; go faster.
>      opt3 at minlat      = minlat
>      opt3 at maxlat      = maxlat
>      jjj_mask3        = shapefile_mask_data(data3({
> minlat:maxlat},{minlon:maxlon}),shp_fname,opt3)
>
> ;---Write new mask to file
>      system("rm -f " + mask_fname3)
>      fout3           = addfile(mask_fname3,"c")
>      fout3->jjj_mask3  = jjj_mask3
>    else
>      print("Reading mask off file.")
>
> ;---Read the new mask from the NetCDF file
>      fmask3    = addfile(mask_fname3,"r")
>      jjj_mask3  = fmask3->jjj_mask3
>   end if
>
>    umask_data3 = where(jjj_mask3.eq.1,data3({minlat:
> maxlat},{minlon:maxlon}),data3 at _FillValue)
>    copy_VarMeta(data3({minlat:maxlat},{minlon:maxlon}),umask_data3)
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> mask_fname4="15113020_mask.nc"
> if(create_mask) then
>     print("create the mask file:  ")
>
> ;---Create a new mask using a shapefile of Henan
>      udims4 = dimsizes(data4)
>      opt4             = True
>      opt4 at return_mask = True
> ;    opt4 at debug       = True
>      opt4 at minlon      = minlon     ; Makes the shapefile masking
>      opt4 at maxlon      = maxlon     ; go faster.
>      opt4 at minlat      = minlat
>      opt4 at maxlat      = maxlat
>      jjj_mask4        = shapefile_mask_data(data4({
> minlat:maxlat},{minlon:maxlon}),shp_fname,opt4)
>
> ;---Write new mask to file
>      system("rm -f " + mask_fname4)
>      fout4           = addfile(mask_fname4,"c")
>      fout4->jjj_mask4  = jjj_mask4
>    else
>      print("Reading mask off file.")
>
> ;---Read the new mask from the NetCDF file
>      fmask4    = addfile(mask_fname4,"r")
>      jjj_mask4  = fmask4->jjj_mask4
>   end if
>
>    umask_data4 = where(jjj_mask4.eq.1,data4({minlat:
> maxlat},{minlon:maxlon}),data4 at _FillValue)
>    copy_VarMeta(data4({minlat:maxlat},{minlon:maxlon}),umask_data4)
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> ;; plot
>   type="png"
>   wks = gsn_open_wks(type,"2015112920-113020_jjj")     ;
> Open a workstation and
>   colors=(/"White","Black","(/.027,.729,.145/)","(/.431,.824,.035/)",\
>           "(/.800,.937,.012/)","(/1.00,.969,0.00/)","(/1.00,.871,0.00/)",\
>           "(/1.00,.710,0.00/)","(/1.00,.549,0.00/)","(/0.00,.757,1.00/)",\
>           "(/0.00,0.455,1.00/)","(/0.00,.122,1.00/)","(/1.
> 00,.275,0.00/)",\
>           "(/1.00,0.059,0.00/)"/)
>   gsn_define_colormap(wks,colors)
>
>    res                       = True     ; plot mods desired
>    res at gsnMaximize           = True
>    res at gsnDraw               = False
>    res at gsnFrame              = False
>
>    res at mpOutlineOn           = False
>    res at cnFillOn              = True     ; turn on color fill
>    res at cnLinesOn             = False    ; turn off contour lines
>    res at cnLineLabelsOn        = False    ; turn off contour line labels
>    ;res at lbLabelBarOn          = False    ; will turn on in panel
>    res at gsnAddCyclic          = False    ; data already has cyclic point
>    res at mpFillColors          = (/-1,0,-1,-1/)  ; background color is white
>
>    res at mpDataBaseVersion     = "MediumRes"
>    res at mpMinLonF             = minlon
>    res at mpMaxLonF             = maxlon
>    res at mpMinLatF             = minlat
>    res at mpMaxLatF             = maxlat
>    res at mpCenterLonF          = (minlon+maxlon)/2.
>
>    res1 =  True
>    res1 =  res
>    res1 at tmXBMode = "Explicit"
>    res1 at tmXBValues =(/113.40,114.7,116.0,117.3,118.6,119.9/)
>    res1 at tmXBLabels =(/"113.40","114.7","116.0","117.3","118.6","119.9"/)
>
>    res1 at tmYLMode = "Explicit"
>    res1 at tmYLValues =(/36.00,37.1,38.2,39.3,40.3,41.4,42.70/)
>    res1 at tmYLLabels =(/"36.00","37.1","38.2","39.3","40.3","41.4","42.70"/)
>
>    res1 at gsnCenterString  = "2015-11-29-20"
>
>    plot1 = gsn_csm_contour_map(wks,umask_data1,res1)
>    wmsetp("vrs - size of reference vector in user space",15.0)
>    wmsetp("vrn - size of reference vector on plot in NDC space", 0.1)
>    wmsetp("vcw - linewidth scale",3.)
>    wmsetp("vcc - vector color",1)
>    wmsetp("vch - controls the vector arrow head size",0.01)
>    wmvectmap(wks, tofloat(fields1(2,:)), tofloat(fields1(1,:)), tofloat(
> fields1(3,:))*2.5, tofloat(fields1(4,:))*2.5)
>    wmvlbl(wks,0.95,0.)
>
>    res2 =  True
>    res2 =  res
>    res2 at tmXBMode = "Explicit"
>    res2 at tmXBValues =(/113.40,114.7,116.0,117.3,118.6,119.9/)
>    res2 at tmXBLabels =(/"113.40","114.7","116.0","117.3","118.6","119.9"/)
>
>    res2 at tmYLMode = "Explicit"
>    res2 at tmYLValues =(/36.00,37.1,38.2,39.3,40.3,41.4,42.70/)
>    res2 at tmYLLabels =(/"36.00","37.1","38.2","39.3","40.3","41.4","42.70"/)
>
>    res2 at gsnCenterString  = "2015-11-30-08"
>    plot2 = gsn_csm_contour_map(wks,umask_data2,res2)
>    ; wmsetp("vrs - size of reference vector in user space",15.0)
>    ; wmsetp("vrn - size of reference vector on plot in NDC space", 0.1)
>    ; wmsetp("vcw - linewidth scale",3.)
>    ; wmsetp("vcc - vector color",1)
>    ; wmsetp("vch - controls the vector arrow head size",0.01)
>    ; wmvectmap(wks, tofloat(fields2(2,:)), tofloat(fields2(1,:)), tofloat(
> fields2(3,:))*2.5, tofloat(fields2(4,:))*2.5)
>
>
>    res3 =  True
>    res3 =  res
>    res3 at tmXBMode = "Explicit"
>    res3 at tmXBValues =(/113.40,114.7,116.0,117.3,118.6,119.9/)
>    res3 at tmXBLabels =(/"113.40","114.7","116.0","117.3","118.6","119.9"/)
>
>    res3 at tmYLMode = "Explicit"
>    res3 at tmYLValues =(/36.00,37.1,38.2,39.3,40.3,41.4,42.70/)
>    res3 at tmYLLabels =(/"36.00","37.1","38.2","39.3","40.3","41.4","42.70"/)
>
>    res3 at gsnCenterString  = "2015-11-30-14"
>    plot3 = gsn_csm_contour_map(wks,umask_data3,res3)
>    ; wmsetp("vrs - size of reference vector in user space",15.0)
>    ; wmsetp("vrn - size of reference vector on plot in NDC space", 0.1)
>    ; wmsetp("vcw - linewidth scale",3.)
>    ; wmsetp("vcc - vector color",1)
>    ; wmsetp("vch - controls the vector arrow head size",0.01)
>    ; wmvectmap(wks, tofloat(fields3(2,:)), tofloat(fields3(1,:)), tofloat(
> fields3(3,:))*2.5, tofloat(fields3(4,:))*2.5)
>
>    res4 =  True
>    res4 =  res
>    res4 at tmXBMode = "Explicit"
>    res4 at tmXBValues =(/113.40,114.7,116.0,117.3,118.6,119.9/)
>    res4 at tmXBLabels =(/"113.40","114.7","116.0","117.3","118.6","119.9"/)
>
>    res4 at tmYLMode = "Explicit"
>    res4 at tmYLValues =(/36.00,37.1,38.2,39.3,40.3,41.4,42.70/)
>    res4 at tmYLLabels =(/"36.00","37.1","38.2","39.3","40.3","41.4","42.70"/)
>
>    res4 at gsnCenterString  = "2015-11-30-20"
>    plot4 = gsn_csm_contour_map(wks,umask_data4,res4)
>    ; wmsetp("vrs - size of reference vector in user space",15.0)
>    ; wmsetp("vrn - size of reference vector on plot in NDC space", 0.1)
>    ; wmsetp("vcw - linewidth scale",3.)
>    ; wmsetp("vcc - vector color",1)
>    ; wmsetp("vch - controls the vector arrow head size",0.01)
>    ; wmvectmap(wks, tofloat(fields4(2,:)), tofloat(fields4(1,:)), tofloat(
> fields4(3,:))*2.5, tofloat(fields4(4,:))*2.5)
>
>   if(add_shapefile_outlines) then
>      lnres  = True
>      poly1 = gsn_add_shapefile_polylines(wks,plot1,shp_fname,lnres)
>      poly2 = gsn_add_shapefile_polylines(wks,plot2,shp_fname,lnres)
>      poly3 = gsn_add_shapefile_polylines(wks,plot3,shp_fname,lnres)
>      poly4 = gsn_add_shapefile_polylines(wks,plot4,shp_fname,lnres)
>   end if
>
>    pres                  = True
>    pres at gsnMaximize      = True
>    pres at gsnPanelLabelBar = False
>    pres at txString           = "PM2.5 and station vector"
>    ;pres at pmLabelBarWidthF = 0.6
>    pres at lbLabelFontHeightF  = 0.01              ; make labels smaller
>
>    ; wmsetp("vrs - size of reference vector in user space",15.0)
>    ; wmsetp("vrn - size of reference vector on plot in NDC space", 0.1)
>    ; wmsetp("vcw - linewidth scale",3.)
>    ; wmsetp("vcc - vector color",1)
>    ; wmsetp("vch - controls the vector arrow head size",0.01)
>    ; wmvectmap(wks, tofloat(fields1(2,:)), tofloat(fields1(1,:)), tofloat(
> fields1(3,:))*2.5, tofloat(fields1(4,:))*2.5)
>    ; wmvectmap(wks, tofloat(fields2(2,:)), tofloat(fields2(1,:)), tofloat(
> fields2(3,:))*2.5, tofloat(fields2(4,:))*2.5)
>    ; wmvectmap(wks, tofloat(fields3(2,:)), tofloat(fields3(1,:)), tofloat(
> fields3(3,:))*2.5, tofloat(fields3(4,:))*2.5)
>    ; wmvectmap(wks, tofloat(fields4(2,:)), tofloat(fields4(1,:)), tofloat(
> fields4(3,:))*2.5, tofloat(fields4(4,:))*2.5)
>    ; wmsetp("vrs",5.)
>    ; wmsetp("vrn",0.1)
>    ; wmsetp("vlb - for setting the background color",0)
>    ; wmsetp("vrs",5.)
>
>    wmvlbl(wks, 0.8 ,0.2)
>
>    gsn_panel(wks,(/plot1,plot2,plot3,plot4/),(/2,2/),pres)
>
>    ;draw(plot)
>
>   ; wmsetp("vch", 0.05)
>   ; wmsetp("vcc", 1)
>   ; wmsetp("vcw", 3.)
>   ; wmsetp("wbs", 0.05)
>   ; wmsetp("col", 1)
>   ; wmsetp("wbs", 0.06)
>   ; wmsetp("ezf",2)
>   ; wmsetp("wbs",0.12)
>   ; wmsetp("col", 1)
>   ; wmsetp("sht", 2.0)
>   ; wmsetp("ars",0.05)
>   ; wmsetp("arl",1.5)
>   ; wmsetp("blw", 4.0)
>   ; wmsetp("wbs", 0.03)
>
>         ; wmsetp("vrs - size of reference vector in user space",15.0)
>         ; wmsetp("vrn - size of reference vector on plot
> in NDC space", 0.1)
>         ; wmsetp("vcw - linewidth scale",3.)
>         ; wmsetp("vcc - vector color",1)
>         ; wmsetp("vch - controls the vector arrow head size",0.01)
>         ; wmvectmap(wks, tofloat(fields1(2,:)), tofloat(fields1(1,:)),
> tofloat(fields1(3,:))*2.5, tofloat(fields1(4,:))*2.5)
>         ; wmvectmap(wks, tofloat(fields2(2,:)), tofloat(fields2(1,:)),
> tofloat(fields2(3,:))*2.5, tofloat(fields2(4,:))*2.5)
>         ; wmvectmap(wks, tofloat(fields3(2,:)), tofloat(fields3(1,:)),
> tofloat(fields3(3,:))*2.5, tofloat(fields3(4,:))*2.5)
>         ; wmvectmap(wks, tofloat(fields4(2,:)), tofloat(fields4(1,:)),
> tofloat(fields4(3,:))*2.5, tofloat(fields4(4,:))*2.5)
>         ; wmsetp("vrs",5.)
>         ; wmsetp("vrn",0.1)
>         ; wmsetp("vlb - for setting the background color",0)
>         ; wmsetp("vrs",5.)
>        ; wmvlbl(wks,0.85,0.78)
>
>   ; wmvectmap(wks, tofloat(fields(2,:)), tofloat(fields(
> 1,:)), tofloat(fields(3,:)), tofloat(fields(4,:)))
>   ; wmvlbl(wks, 1.0, 0.0)
>
>
>   ; frame(wks)
>
>
> end
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++
> the final figure didn't distribute the windbard to every subplot ,but in
> the center of whole page.
>
> the effect is the above.
>
> anybody tell me the method about how to overlay those wmvectmap in
> individual subplot will be appreciated.
>
>
> thanks
>
>
>
> ------------------------------
> dyjbean at gmail.com
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161107/8e57de14/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InsertPic_E2CD.png
Type: image/png
Size: 185178 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161107/8e57de14/attachment-0001.png 


More information about the ncl-talk mailing list