<div dir="ltr"><div><div><div><div><div><div>Hi, <br><br></div>It looks like you want to adjust your NDC coordinates for the legend. You can add this call right before your call to draw:<br><br> drawNDCGrid(wks)<br><br></div>It will help with determining appropriate NDC coords. (You also have to add this load command at the top:<br><br></div> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br><br></div>If you want nice left-justified labels within the legend columns, you could add this resource:<br><br></div> res@txJust = "LeftCenter"<br><br><br></div><div>All that said, you may not have enough room in the existing bottom margin to plot your legend, in which case you'll want to push your map upwards on the page; see the examples at <br><br> <a href="http://ncl.ucar.edu/Applications/viewport.shtml">http://ncl.ucar.edu/Applications/viewport.shtml</a><br><br></div><div>for how to adjust the "viewport".<br><br></div><div>Finally, as for the black line, that's coming from NCL's map database. To turn it off, I *think* its:<br><br><br></div><div> res@mpOutlineOn = False<br><br></div><div>I hope that helps...<br></div><div>Rick<br><br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 4, 2015 at 2:57 PM, Jesús Garcia Rosales <span dir="ltr"><<a href="mailto:jesus21gr@gmail.com" target="_blank">jesus21gr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi users,</div><div>I have a problem with the position of my stations names and the map( look the image). Additionally I would like to eliminate the black line in the map and only visualize the shape file, I don't know how to do that. Please help me!, Thank for your time.</div><div><br></div><div>My script is the next:</div><div><br></div><div><div><br></div><div>;**********************************************************************</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div><br></div><div>begin</div><div> latN = -10.5</div><div> latS = -14.0</div><div> lonL = -77.</div><div> lonR = -73.</div><div><br></div><div> ; Coordenadas de cada estación que se quiere ubicar</div><div><br></div><div> lat=(/-12.04, -10.69, -11.4, -11.33, -12.25, -12.12, -11.4, -11.75, -11.88, -11.62, \</div><div> -11.78, -12, -12.16, -12.38, -12.35, -12.58, -12.78, -12.98, -13.06, -12.84/)</div><div><br></div><div> lon=(/-75.32, -76.26, -76.33, -76.4, -75.36, -75.43, -75.69, -75.13, -75.27, -75.01,\</div><div> -75.47, -75.22, -75.23, -74.85, -75.08, -75.24, -75.01, -74.72, -74.14, -74.57/)</div><div><br></div><div><br></div><div><br></div><div><br></div><div> wks = gsn_open_wks("x11","graficas/estaciones")</div><div><br></div><div> res = True</div><div> res@gsnFrame = False ; So we can draw markers</div><div> res@gsnMaximize = True ; affects ps, eps, pdf only</div><div> res@gsnPaperOrientation = "portrait" ; force portrait</div><div><br></div><div> res@tiMainString = "Ubicacion de las estaciones"</div><div><br></div><div><br></div><div> res@mpMinLatF = latS ; range to zoom in on</div><div> res@mpMaxLatF = latN</div><div> res@mpMinLonF = lonL</div><div> res@mpMaxLonF = lonR</div><div> res@mpCenterLonF = (lonL+lonR)*0.5</div><div> res@mpBottomPointLatF = 100</div><div><br></div><div><br></div><div> res@mpFillOn = False</div><div> res@mpOutlineDrawOrder = "PostDraw"</div><div> res@mpFillDrawOrder = "PreDraw"</div><div> res@mpOutlineBoundarySets = "GeophysicalAndUSStates"</div><div> res@mpUSStateLineColor = "White" ; "Gray10"</div><div> res@mpUSStateLineDashPattern = 5</div><div> res@mpGridAndLimbOn = False</div><div><br></div><div><br></div><div> res@pmTickMarkDisplayMode = "Always"</div><div>;</div><div>; Draw the map (frame won't get advanced because gsnFrame was set to False).</div><div>;</div><div> yres = True ; panel resource list</div><div> yres@gsnMaximize = True ; maximize the plots</div><div> yres@gsnPaperOrientation = "portrait" ; set paper orientation to portrait</div><div> yres@gsnPanelYWhiteSpacePercent = 5.0 </div><div><br></div><div><br></div><div> map = gsn_csm_map(wks,res)</div><div><br></div><div><br></div><div><br></div><div> ;gsn_panel(wks,map,(/1,1/),yres)</div><div>; Draw markers on the plot in the lat/lon locations.</div><div>;</div><div> colors = (/"black","RoyalBlue","Yellow","antiquewhite3","darkolivegreen1","burlywood4",\</div><div> "olivedrab","palevioletred","PaleGreen","Wheat","Brown","cadetblue","darkorchid",\</div><div> "darkorchid4","deepskyblue3","forestgreen","chartreuse3","chartreuse","darkgoldenrod2","chocolate2"/)</div><div> labels = (/"Huayao","Cerro de Pasco","Marcapoma","Yantac","Laive","Jarpa","Tarma","Comas"\</div><div> ,"Ingenio","Ricran","Jauja","Santa Ana","Viques","Pampas","Pilchaca","Huancalpi"\</div><div> ,"Huancavelica","Lircay","Quinua","Acobamba"/)</div><div><br></div><div>; Manually specify location of legends</div><div> </div><div> 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> xtxt = (/0.22,0.225,0.225,0.225,0.225,0.42,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> 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> 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><br></div><div> mkres = True</div><div> mkres@gsMarkerIndex = 17 ; Filled circle</div><div> mkres@gsMarkerSizeF = 0.06 ;0.03</div><div><br></div><div> txres = True</div><div> txres@txFontHeightF = 0.013</div><div><br></div><div><br></div><div><br></div><div><br></div><div>; add location and text for each station</div><div><br></div><div> do i = 0,19</div><div> mkres@gsMarkerColor = colors(i)</div><div> gsn_polymarker(wks,map,lon(i),lat(i),mkres)</div><div> gsn_polymarker_ndc(wks,xleg(i),yleg(i),mkres)</div><div> gsn_text_ndc (wks,labels(i),xtxt(i),ytxt(i),txres)</div><div> end do</div><div><br></div><div> ;Abriendo el archivo .shp</div><div>cuenca_mantaro_shp_name = "/home/usuario/Escritorio/alan/cuencas/UH.shp"</div><div><br></div><div> lnres = True</div><div> lnres@gsLineColor = "red"</div><div> lnres@gsLineThicknessF = 2 </div><div><br></div><div>can_id = gsn_add_shapefile_polylines(wks,map,cuenca_mantaro_shp_name,lnres)</div><div><br></div><div><br></div><div><br></div><div><br></div><div> draw(map)</div><div> frame(wks)</div><div>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>