<div dir="ltr"><div><div>Hi,<br><br></div>I am unaware of any way of doing that directly with NCL.  Offhand, I&#39;d say you&#39;d have to treat each line  from the shapefile individually, clipping each one against the shape (if this is a simple, rotated ellipse, it shouldn&#39;t be too hard to do) and draw.<br><br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 23, 2016 at 11:02 AM, Jesús Garcia Rosales <span dir="ltr">&lt;<a href="mailto:jesus21gr@gmail.com" target="_blank">jesus21gr@gmail.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 dir="ltr"><span style="font-family:&#39;Diaria Light Pro&#39;,sans-serif;font-size:15px;line-height:26px;background-color:rgb(245,246,245)">Hi everybody</span><div style="font-family:&#39;Diaria Light Pro&#39;,sans-serif;font-size:15px;line-height:26px;background-image:inherit!important;background-color:rgb(245,246,245);background-repeat:inherit!important">I have a doubt about a shapefile in ncl. I want to plot only a part of the shapefile which  is inside in the circle red. But I don&#39;t know how to do that. Please help me. </div><div style="font-family:&#39;Diaria Light Pro&#39;,sans-serif;font-size:15px;line-height:26px;background-image:inherit!important;background-color:rgb(245,246,245);background-repeat:inherit!important">Greetings,</div><div style="font-family:&#39;Diaria Light Pro&#39;,sans-serif;font-size:15px;line-height:26px;background-image:inherit!important;background-color:rgb(245,246,245);background-repeat:inherit!important">Alan</div><div><br></div><div>My script is the next:</div><div><br></div><div><div style="font-size:12.8px">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div style="font-size:12.8px">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div style="font-size:12.8px">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</div><div style="font-size:12.8px">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">begin</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">year= &quot;exp_re&quot;</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;---Open WRF output file.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">a = addfile(&quot;/media/usuario/TOSHIBA/WRF_alan/9km/exp_re/wrfout_2002F.&quot;+year+&quot;.<a href="http://3km.nc/" target="_blank">3km.nc</a>&quot;,&quot;r&quot;)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;---Read terrain height and lat/lon off file.</div><div style="font-size:12.8px">  it        = 0     ; first time step</div><div style="font-size:12.8px">  hgt       = wrf_user_getvar(a,&quot;HGT&quot;,it)    ; Terrain elevation</div><div style="font-size:12.8px">  hgt@lat2d = wrf_user_getvar(a,&quot;XLAT&quot;,it)   ; latitude/longitude</div><div style="font-size:12.8px">  hgt@lon2d = wrf_user_getvar(a,&quot;XLONG&quot;,it)  ; required for plotting</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Grafico</div><div style="font-size:12.8px">;;;;;;;;;;;;; Salida</div><div style="font-size:12.8px"> type = &quot;x11&quot;</div><div style="font-size:12.8px">; type = &quot;pdf&quot;</div><div style="font-size:12.8px"> ;type = &quot;ps&quot;</div><div style="font-size:12.8px">; type = &quot;ncgm&quot;  </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  wks = gsn_open_wks(type,&quot;graficas/topografia_cuenca_estaciones&quot;)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;---Set some basic plot options</div><div style="font-size:12.8px">  res               = True</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  res@gsnMaximize   = True   ; maximize plot in frame</div><div style="font-size:12.8px">  res@gsnDraw       = False</div><div style="font-size:12.8px">  res@gsnFrame      = False</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> ; res@tiMainString  = filename</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  res@cnFillOn      = True  </div><div style="font-size:12.8px">  res@cnFillPalette = &quot;OceanLakeLandSnow&quot;</div><div style="font-size:12.8px">  res@cnLinesOn     = False</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  res@mpProjection  = &quot;CylindricalEquidistant&quot;    ; The default</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;---Zoom in on plot</div><div style="font-size:12.8px">  res@mpMinLatF     = -13.8</div><div style="font-size:12.8px">  res@mpMaxLatF     = -10.5</div><div style="font-size:12.8px">  res@mpMinLonF     = -77</div><div style="font-size:12.8px">  res@mpMaxLonF     = -73.6</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;---Additional resources desired</div><div style="font-size:12.8px">  res@pmTickMarkDisplayMode = &quot;Always&quot;   ; nicer tickmarks</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  res@mpDataBaseVersion     = &quot;MediumRes&quot;       ; better and more map outlines</div><div style="font-size:12.8px">  res@mpDataSetName         = &quot;Earth..4&quot;</div><div style="font-size:12.8px">  res@mpOutlineBoundarySets = &quot;AllBoundaries&quot;</div><div style="font-size:12.8px">  res@mpOutlineOn           = True</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  res@lbOrientation         = &quot;Vertical&quot;</div><div style="font-size:12.8px">  res@tiMainOffsetYF        = -0.03           ; Move the title down</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">;---Change contour levels to better match the color map being used</div><div style="font-size:12.8px">  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;</div><div style="font-size:12.8px">  res@cnLevels = (/10,100,200,400,600,800,1000,1200,1400,1600,1800,2000,\</div><div style="font-size:12.8px">                  2200,2400,2800,3000,3200,3400,3600,3800,4000,4200,4400,4600,4800,5000,\</div><div style="font-size:12.8px">                  5200,5400/)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  res@gsnAddCyclic = False</div><div style="font-size:12.8px"><span style="font-size:12.8px">  </span><br></div><div style="font-size:12.8px"> plot = gsn_csm_contour_map(wks,hgt,res)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">alres = True</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  latN = -10.5</div><div style="font-size:12.8px">  latS = -13.8         ;-13.58</div><div style="font-size:12.8px">  lonL  = -77</div><div style="font-size:12.8px">  lonR  = -73.6</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  ; Coordenadas de cada estación que se quiere ubicar</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  lat=(/-12.04, -10.69, -11.4, -11.33, -12.25, -12.12, -11.4, -11.75, -11.88, -11.62, \</div><div style="font-size:12.8px">        -11.78, -12, -12.16, -12.38, -12.35, -12.58, -12.78, -12.98, -13.06, -12.84/)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  lon=(/-75.32, -76.26, -76.33, -76.4, -75.36, -75.43, -75.69, -75.13, -75.27, -75.01,\</div><div style="font-size:12.8px">        -75.47, -75.22, -75.23, -74.85, -75.08, -75.24, -75.01, -74.72, -74.14, -74.57/)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">colors =(/&quot;blue3&quot;/)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> ;colors = (/&quot;orange2&quot;,&quot;forestgreen&quot;,&quot;dodgerblue2&quot;,&quot;forestgreen&quot;,&quot;orange2&quot;,&quot;orange2&quot;,&quot;forestgreen&quot;,&quot;dodgerblue2&quot;,\</div><div style="font-size:12.8px">  ;         &quot;dodgerblue2&quot;,&quot;olivedrab2&quot;,&quot;forestgreen&quot;,&quot;orange2&quot;,&quot;orange2&quot;,&quot;olivedrab2&quot;,&quot;darkorchid2&quot;,&quot;olivedrab2&quot;,\</div><div style="font-size:12.8px">   ;        &quot;forestgreen&quot;,&quot;darkorchid2&quot;,&quot;olivedrab2&quot;,&quot;darkorchid2&quot;/)</div><div style="font-size:12.8px"> </div><div style="font-size:12.8px">; orange2</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  labels = (/&quot;Huayao&quot;,&quot;Cerro de Pasco&quot;,&quot;Marcapomacocha&quot;,&quot;Yantac&quot;,&quot;Laive&quot;,&quot;Jarpa&quot;,&quot;Tarma&quot;,&quot;Comas&quot;\</div><div style="font-size:12.8px">           ,&quot;Ingenio&quot;,&quot;Ricran&quot;,&quot;Jauja&quot;,&quot;Santa Ana&quot;,&quot;Viques&quot;,&quot;Pampas&quot;,&quot;Pilchaca&quot;,&quot;Huancalpi&quot;\</div><div style="font-size:12.8px">            ,&quot;Huancavelica&quot;,&quot;Lircay&quot;,&quot;Quinua&quot;,&quot;Acobamba&quot;/)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">; Manually specify location of legends</div><div style="font-size:12.8px">        </div><div style="font-size:12.8px">  xleg = (/0.15,0.15,0.15,0.15,0.15,0.35,0.35,0.35,0.35,0.35,0.56,0.56,0.56,0.56,0.56,0.80,0.80,0.80,0.80,0.80/); Location of</div><div style="font-size:12.8px">  xtxt = (/0.22,0.225,0.225,0.225,0.225,0.44,0.44,0.44,0.44,0.44,0.65,0.66,0.66,0.66,0.66,0.88,0.88,0.88,0.88,0.88/)  ; legend markers</div><div style="font-size:12.8px">  yleg = (/0.20,0.17,0.14,0.11,0.08,0.20,0.17,0.14,0.11,0.08,0.20,0.17,0.14,0.11,0.08,0.20,0.17,0.14,0.11,0.08/)   ; and text</div><div style="font-size:12.8px">  ytxt = (/0.20,0.17,0.14,0.11,0.08,0.20,0.17,0.14,0.11,0.08,0.20,0.17,0.14,0.11,0.08,0.20,0.17,0.14,0.11,0.08/)  ; strings.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  mkres               = True</div><div style="font-size:12.8px">  mkres@gsMarkerIndex = 17     ; Filled circle</div><div style="font-size:12.8px">  mkres@gsMarkerSizeF = 0.05    ;0.03</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  txres               = True</div><div style="font-size:12.8px">  txres@txFontHeightF = 0.014</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">    mkres@gsMarkerColor = colors</div><div style="font-size:12.8px">  la=  gsn_add_polymarker(wks,plot,lon(:),lat(:),mkres)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> cuenca_mantaro_shp_name = &quot;/home/usuario/Escritorio/alan/cuencas/UH.shp&quot;</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  lnres                  = True</div><div style="font-size:12.8px">  lnres@gsLineColor      = &quot;black&quot;</div><div style="font-size:12.8px">  lnres@gsLineThicknessF = 4 </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> can_id = gsn_add_shapefile_polylines(wks,plot,cuenca_mantaro_shp_name,lnres)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">overlay(la,can_id)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> draw(plot)</div><div style="font-size:12.8px"> frame(wks)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  end</div></div></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>