<div dir="ltr"><div class="gmail_default" style="font-size:small">I think these are map outlines that you see.  Try setting:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">res@mpOutlineOn = False</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 26, 2015 at 9:21 AM, <a href="mailto:dyjbean@163.com">dyjbean@163.com</a> <span dir="ltr">&lt;<a href="mailto:dyjbean@163.com" target="_blank">dyjbean@163.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<table width="99.99%" height="100%" style="padding:10px;background-color:transparent" border="0" cellpadding="0" cellspacing="0" background="cid:_Foxmail.1@18b36621-24fd-776e-b2b0-bef5be473df6">
<tbody><tr>
<td valign="top" style="width:100%;height:100%;line-height:160%;font-size:10.5pt">
<div>
<div><span></span>hi,</div><div>  i made a plot with shapefile , but there exist some extra lines in figure, as follows:</div><div>    <img src="cid:_Foxmail.1@e156f4a0-fd5a-e6ea-ccb7-7cfeac5ba16b" border="0" style="font-size:10.5pt;line-height:160%;background-color:transparent"></div>
<div><br></div><div> there some extra lines on figure above. how can i get rid of them?</div><div><br></div><div><br></div><div>the following is my script:</div><div>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div><div><span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br>load &quot;./shapefile_mask_data.ncl&quot;<br><br>begin<br>;forgname=&quot;../../globecover_hubei_liuhuan_usgs_ronghe_snow-ice1.txt&quot;<br>forgname=&quot;beijing_globecover_liuhuan30_usgs_changed.txt&quot;<br>;fconname=&quot;../../globecover_huabei_liuhuan_usgs_new_allocate1.txt&quot;<br>fconname=&quot;beijing_globecover_liuhuan30_usgs_changed_lir-mir-hir.txt&quot;<br><br>onlat=5403<br>omlon=5403<br><br>nnlat=1801<br>nmlon=1801<br><br>odat=new((/onlat,omlon/),&quot;integer&quot;,&quot;No_FillValue&quot;)<br>ndat=new((/nnlat,nmlon/),&quot;integer&quot;,&quot;No_FillValue&quot;)<br><br>odat=readAsciiTable(forgname,omlon,&quot;integer&quot;,5)<br>ndat=asciiread(fconname,(/nnlat,nmlon/),&quot;integer&quot;)<br>delete(odat@_FillValue)<br>delete(ndat@_FillValue)<br><br>;; confused lc<br>olat=new((/onlat/),&quot;float&quot;,&quot;No_FillValue&quot;)<br>olon=new((/omlon/),&quot;float&quot;,&quot;No_FillValue&quot;)<br><br>do i=0,onlat-1<br> olat(i)=45.00413067-i*0.0027778<br>end do<br><br><br>do j=0,omlon-1<br> olon(j)=109.99606533+j*0.0027778<br>end do<br><br>olat!0=&quot;lat&quot;<br>olat@units=&quot;degrees_north&quot;<br>olat@long_name=&quot;latitude&quot;<br><br>olon!0=&quot;lon&quot;<br>olon@units=&quot;degrees_east&quot;<br>olon@long_name=&quot;longitude&quot;<br><br>odat!0=&quot;lat&quot;<br>odat!1=&quot;lon&quot;<br>odat&amp;lat=olat<br>odat&amp;lon=olon<br>odat@units=&quot;&quot;<br>odat@long_name=&quot;land cover confused with globaland30 and globercover&quot;<br><br>;; new classified lc<br>nlat=new((/nnlat/),&quot;float&quot;,&quot;No_FillValue&quot;)<br>nlon=new((/nmlon/),&quot;float&quot;,&quot;No_FillValue&quot;)<br><br>do i=0,nnlat-1<br> nlat(i)=45.00413067-i*0.0083334<br>end do<br><br><br>do j=0,nmlon-1<br> nlon(j)=109.99606533+j*0.0083334<br>end do<br><br>nlat!0=&quot;lat&quot;<br>nlat@units=&quot;degrees_north&quot;<br>nlat@long_name=&quot;latitude&quot;<br><br>nlon!0=&quot;lon&quot;<br>nlon@units=&quot;degrees_east&quot;<br>nlon@long_name=&quot;longitude&quot;<br><br>ndat!0=&quot;lat&quot;<br>ndat!1=&quot;lon&quot;<br>ndat&amp;lat=nlat<br>ndat&amp;lon=nlon<br>ndat@units=&quot;&quot;<br>ndat@long_name=&quot;land cover new categories after confused&quot;<br><br>;<br>; If you already have the mask NetCDF file, set this to False.<br>; Creating the mask can be slow!<br>;<br>   CREATE_MASK = True<br><br>;---Whether to draw lat/lon points and shapefile outlines<br>   ADD_LATLON_POINTS      = False<br>   ADD_SHAPEFILE_OUTLINES = True<br><br>;---Name of shapefile containing USA outlines<br>   shp_fname = &quot;jingjinji.shp&quot;<br><br>;---Name of file to write mask to or to read mask from.<br>   mask_oname = &quot;<a href="http://jingjinji_mask_300m.nc" target="_blank">jingjinji_mask_300m.nc</a>&quot;<br>   mask_nname = &quot;<a href="http://jingjinji_mask_1km.nc" target="_blank">jingjinji_mask_1km.nc</a>&quot;<br><br>;---Rough area we are interested in. Everything outside this will be masked.<br>   minlon = 113.<br>   maxlon = 120.<br>   minlat =  36.0<br>   maxlat =  43.0<br><br>;; odat<br>if(CREATE_MASK) then<br>     print(&quot;Creating the mask file...&quot;)<br><br>;---Create a new mask using a shapefile of USA<br>     odims = dimsizes(odat)<br>     opto             = True<br>     opto@return_mask = True<br>;    opto@debug       = True<br>     opto@minlon      = minlon     ; Makes the shapefile masking<br>     opto@maxlon      = maxlon     ; go faster.<br>     opto@minlat      = minlat<br>     opto@maxlat      = maxlat<br>     odat_mask        = shapefile_mask_data(odat,shp_fname,opto)<br><br>;---Write new mask to file<br>     system(&quot;rm -f &quot; + mask_oname)<br>     oout           = addfile(mask_oname,&quot;c&quot;)<br>     oout-&gt;odat_mask = odat_mask<br>   else<br>     print(&quot;Reading mask off file.&quot;)<br><br>;---Read the new mask from the NetCDF file<br>     omask    = addfile(mask_oname,&quot;r&quot;)<br>     odat_mask = omask-&gt;odat_mask<br>   end if<br><br>;; ndat<br>if(CREATE_MASK) then<br>     print(&quot;Creating the mask file...&quot;)<br><br>;---Create a new mask using a shapefile of USA<br>     ndims = dimsizes(ndat)<br>     optn             = True<br>     optn@return_mask = True<br>;    optn@debug       = True<br>     optn@minlon      = minlon     ; Makes the shapefile masking<br>     optn@maxlon      = maxlon     ; go faster.<br>     optn@minlat      = minlat<br>     optn@maxlat      = maxlat<br>     ndat_mask        = shapefile_mask_data(ndat,shp_fname,optn)<br><br>;---Write new mask to file<br>     system(&quot;rm -f &quot; + mask_nname)<br>     nout           = addfile(mask_nname,&quot;c&quot;)<br>     nout-&gt;ndat_mask = ndat_mask<br>   else<br>     print(&quot;Reading mask off file.&quot;)<br><br>;---Read the new mask from the NetCDF file<br>     nmask    = addfile(mask_nname,&quot;r&quot;)<br>     ndat_mask = nmask-&gt;ndat_mask<br>   end if<br><br>;---Create masked data array<br>   omask = where(odat_mask.eq.1,odat,odat@_FillValue)<br>   copy_VarMeta(odat,omask)<br><br>;---Create masked data array<br>   nmask = where(ndat_mask.eq.1,ndat,ndat@_FillValue)<br>   copy_VarMeta(ndat,nmask)<br><br><br>print(odat(onlat-1,omlon-1))<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;; create plot<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>plot=new(2,&quot;graphic&quot;)<br>info=(/                        \<br>      &quot;1 urban_and_built-in&quot;   ,\<br>      &quot;2 dryland_cropland&quot;     ,\<br>      &quot;3 irrigated_cropland&quot;   ,\<br>      &quot;4 mixed_dry_cropland&quot;   ,\<br>      &quot;5 cropland_grassland&quot;   ,\<br>      &quot;6 cropland_woodland&quot;    ,\<br>      &quot;7 grassland&quot;            ,\<br>      &quot;8 shrubland&quot;            ,\<br>      &quot;9 mixed_shrub_grassland&quot;,\<br>      &quot;10 savanna&quot;              ,\<br>      &quot;11 deciduous_broadleaf&quot;  ,\<br>      &quot;12 deciduous_needleleaf&quot; ,\<br>      &quot;13 evergreen_broadleaf&quot;  ,\<br>      &quot;14 evergreen_needleleaf&quot; ,\<br>      &quot;15 mixed_forest&quot;         ,\<br>      &quot;16 water&quot;                ,\<br>      &quot;17 herbaceous_wetland&quot;   ,\<br>      &quot;18 wooded_wetland&quot;       ,\<br>      &quot;19 barren_or_sparse&quot;     ,\<br>      &quot;31 low_intensity_res&quot;    ,\<br>      &quot;32 mid_intensity_res&quot;    ,\<br>      &quot;33 high_intensity_res&quot;/)<br><br>ninfo=dimsizes(info)<br><br>  ninfo = dimsizes(info)        ; # of classifications<br><br><br>;************************************************<br>; create plot<br>;************************************************<br>  pltType = &quot;png&quot;               ; ps, pdf, png, x11, eps<br><br><br><br>  colorscheme =(/&quot;red&quot;,&quot;SpringGreen2&quot;,&quot;SpringGreen3&quot;,&quot;springgreen&quot;,\<br>       &quot;limegreen&quot;,&quot;darkolivegreen3&quot;,&quot;green&quot;,&quot;lightsalmon&quot;,&quot;green3&quot;,\<br>        &quot;LightSeaGreen&quot;,&quot;palegreen&quot;,&quot;olivedrab3&quot;,&quot;chartreuse2&quot;,&quot;chartreuse3&quot;,       \<br>        &quot;darkgreen&quot;,&quot;blue&quot;,&quot;hotpink2&quot;,&quot;hotpink&quot;,&quot;light cyan&quot;,           \<br>        &quot;khaki1&quot;,&quot;violetred1&quot;,&quot;purple3&quot;/)<br><br>  ncolors = dimsizes(colorscheme)<br>  if (ninfo.ne.ncolors) then             ; make sure # of colors match categories (classes)<br>      print(&quot;size mismatch: ninfo=&quot;+ninfo+&quot;   ncolors=&quot;+ncolors)<br>      exit<br>  end if<br><br>  wks = gsn_open_wks(pltType,&quot;plot_lc_jingjinji_new&quot;)<br>  plot=new(2,graphic)<br>  res                  = True                ; plot mods desired<br>  res@gsnDraw          = False<br>  res@gsnFrame         = False<br>  ;res@gsnMaximize      = True               ; ps, pdf<br>  res@gsnAddCyclic     = False<br><br>  ;res@mpMinLatF   = min(odat&amp;lat)<br>  ;res@mpMaxLatF   = max(odat&amp;lat)<br>  ;res@mpMinLonF   = min(odat&amp;lon)<br>  ;res@mpMaxLonF   = max(odat&amp;lon)<br><br>  res@cnFillOn         = True               ; color Fill<br>  res@cnFillMode       = &quot;RasterFill&quot;<br>  res@cnLinesOn        =  False             ; Turn off contour lines<br>  res@cnLineLabelsOn   =  False<br>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot; ; set explict contour levels<br>  res@cnLevels         = tobyte((/2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,31,32,33/)) ; tobyte(ispan(1,ninfo-1,1)+1)<br>  res@cnFillPalette    = colorscheme        ; distinct colors for categories<br>  res@gsnSpreadColors  = False              ; use each color sequentially<br>  res@cnInfoLabelOn   = False<br><br>  ;res@lbLabelPosition  = &quot;Center&quot;           ; label position<br>  ;res@lbLabelAlignment = &quot;BoxCenters&quot;       ; label orientation<br>  ;res@lbLabelStrings    = (/&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;,&quot;10&quot;,&quot;11&quot;,&quot;12&quot;,&quot;13&quot;,&quot;14&quot;,&quot;15&quot;,&quot;16&quot;,\<br>                        ;&quot;17&quot;,&quot;18&quot;,&quot;19&quot;,&quot;31&quot;,&quot;32&quot;,&quot;33&quot;/)<br> ;res@lbLabelStrings   = ispan(0,ninfo,1)<br>  ;res@lbLabelStride    = 1<br>  ;res@lbLabelAutoStride = False            ; in V6.1.0 and up, this is defaulted<br>                                            ; to True, and overrides lbLabelStride<br>                                            ; default. Set this to ensure that<br>                                            ; your label scheme is preserved.<br>  ;res@pmLabelBarHeightF        =  0.075<br>  ;res@pmLabelBarWidthF         =  0.60      ; default is 0.6<br>  ;res@pmLabelBarOrthogonalPosF =  0.08      ; move up smidge<br><br>  res@mpFillOn         = False<br><br>  ;res@mpGridAndLimbOn   = True<br>  ;res@mpGridLatSpacingF = 5.0<br>  ;res@mpGridLonSpacingF = 5.0<br>  ;res@mpGridLineDashPattern = &quot;2&quot;<br><br>  res@gsnAddCyclic   = False             ; regional data<br>  ;res@trGridType     = &quot;TriangularMesh&quot;<br>  res@tmXBLabelFontHeightF = 0.01        ; Make lon &amp; lat text smaller<br>  res@tmYLLabelFontHeightF = res@tmXBLabelFontHeightF<br><br>  res@gsnLeftString  = &quot;&quot;<br>  res@gsnRightString = &quot;&quot;<br><br>  res1  =  True<br>  res1  =  res<br>  res1@mpMinLatF   = minlat<br>  res1@mpMaxLatF   = maxlat<br>  res1@mpMinLonF   = minlon<br>  res1@mpMaxLonF   = maxlon<br><br>  res1@tmXBMode    = &quot;Explicit&quot;<br>  res1@tmXBValues   = (/113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0/)<br>  res1@tmXBLabels  =  (/&quot;113.0~S~o~N~E&quot;,&quot;114.0~S~o~N~E&quot;,&quot;115.0~S~o~N~E&quot;,&quot;116.0~S~o~N~E&quot;,&quot;117.0~S~o~N~E&quot;,\<br>                        &quot;118.0~S~o~N~E&quot;,&quot;119.0~S~o~N~E&quot;,&quot;120.~S~o~N~E&quot;/)<br><br><br>  res1@tmYLMode    = &quot;Explicit&quot;<br>  res1@tmYLValues   = (/36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0/)<br>  res1@tmYLLabels  = (/&quot;36.0~S~o~N~N&quot;,&quot;37.0~S~o~N~N&quot;,&quot;38.0~S~o~N~N&quot;,&quot;39.0~S~o~N~N&quot;,&quot;40.0~S~o~N~N&quot;,\<br>                       &quot;41.0~S~o~N~N&quot;,&quot;42.0~S~o~N~N&quot;,&quot;43.0~S~o~N~N&quot;/)<br><br>  res1@tiMainString   = &quot;confused LC&quot;<br>  res1@lbLabelBarOn   =  False<br>  plot(0) = gsn_csm_contour_map_ce(wks, omask, res1) ; create plot<br><br>  res2 = True<br>  res2=res<br>  res2@mpMinLatF   = minlat<br>  res2@mpMaxLatF   = maxlat<br>  res2@mpMinLonF   = minlon<br>  res2@mpMaxLonF   = maxlon<br><br>  res2@tmXBMode    = &quot;Explicit&quot;<br>  res2@tmXBValues   = (/113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0/)<br>  res2@tmXBLabels  =  (/&quot;113.0~S~o~N~E&quot;,&quot;114.0~S~o~N~E&quot;,&quot;115.0~S~o~N~E&quot;,&quot;116.0~S~o~N~E&quot;,&quot;117.0~S~o~N~E&quot;,\<br>                        &quot;118.0~S~o~N~E&quot;,&quot;119.0~S~o~N~E&quot;,&quot;120.~S~o~N~E&quot;/)<br><br>  res2@tmYLMode    = &quot;Explicit&quot;<br>  res2@tmYLValues   = (/36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0/)<br>  res2@tmYLLabels  = (/&quot;36.0~S~o~N~N&quot;,&quot;37.0~S~o~N~N&quot;,&quot;38.0~S~o~N~N&quot;,&quot;39.0~S~o~N~N&quot;,&quot;40.0~S~o~N~N&quot;,\<br>                       &quot;41.0~S~o~N~N&quot;,&quot;42.0~S~o~N~N&quot;,&quot;43.0~S~o~N~N&quot;/)<br><br>  res2@lbLabelBarOn   =  False<br>  res2@tiMainString =  &quot;reclassified LC&quot;<br>  plot(1) =  gsn_csm_contour_map_ce(wks,nmask,res2)<br><br>  pres = True<br>  pres@gsnFrame =  False<br>  pres@gsnPanelLabelBar  = True<br>  pres@lbLabelFontHeightF = 0.01<br>  ;pres@gsnPanelBottom = 0.015<br>  pres@lbLabelPosition  = &quot;Center&quot;           ; label position<br>  pres@lbLabelAlignment = &quot;BoxCenters&quot;       ; label orientation<br>  pres@lbLabelStrings    = (/&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;,&quot;10&quot;,&quot;11&quot;,&quot;12&quot;,&quot;13&quot;,&quot;14&quot;,&quot;15&quot;,&quot;16&quot;,\<br>                        &quot;17&quot;,&quot;18&quot;,&quot;19&quot;,&quot;31&quot;,&quot;32&quot;,&quot;33&quot;/)<br> ;pres@lbLabelStrings   = ispan(0,ninfo,1)<br>  pres@lbLabelStride    = 1<br>  pres@lbLabelAutoStride = False<br><br>  gsn_panel(wks,plot,(/1,2/),pres)<br><br>  rtxt = True<br>  rtxt@txJust        = &quot;TopLeft&quot;<br>  rtxt@txFontHeightF = 0.0125<br><br>  ; Add text: rows x columns of text (arbitrary)<br>; Usually must play with xx, yy and txFontHeightF<br><br>  nrow = 5       ; # rows<br>  ncol = 6       ; # columns<br><br>  n  = -1<br>  xx = 0.015                ; arbitrary<br>  do nc=0,ncol-1<br>     yy = 0.20<br>    do nr=0,nrow-1<br>       n = n+1<br>       if (n.le.(ninfo-1)) then<br>           gsn_text_ndc (wks,info(n),xx,yy,rtxt)<br>           yy = yy - 2*rtxt@txFontHeightF<br>       end if<br>    end do<br>    xx = xx + 0.20<br>  end do<br><br> ;draw(plot)<br> frame(wks)<br><br>end<br></span></div><div>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div><div><br></div><div>what kind of properties should i add in the script? </div><div>or something is wrong with the shapefile?</div><div><br></div><div><br></div><div>thanks for your advices</div><div><br></div><div><br></div><div><br></div><hr style="width:210px;min-height:1px" color="#b5c4df" size="1" align="left"><span class="HOEnZb"><font color="#888888">
<div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><a href="mailto:dyjbean@163.com" target="_blank">dyjbean@163.com</a></div></div></span></div>
<div></div></font></span></div>
</td>
</tr>
</tbody></table>
</div><br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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>
<br></blockquote></div><br></div>