<div dir="ltr"><div class="gmail_default" style="font-size:small">Jesus,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don&#39;t see where you are defining &quot;dum3&quot;.  You are treating it as an array, but you haven&#39;t defined its size.  You should have gotten an error message like:</div><div class="gmail_default" style="font-size:small">







<p class=""><span class="">fatal:Undefined identifier: (dum3) is undefined, can&#39;t continue</span></p>
<p class=""><span class="">and then:</span></p><p class="">warning:TransformPostDraw: tfPolyDrawList element 0 is invalid</p><p class="">I modified your script to define &quot;dum3&quot;, and then I just drew the map and added the markers, since I don&#39;t have the data. It worked just fine for me.  See the attached script and image.</p><p class="">--Mary</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 5, 2015 at 2:02 PM, 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"><div>Hi ncl users,</div><div>I have a problem to display my stations&#39; position with differents colors, using gsn_add_polymarker. When I use:</div><div><br></div><div> mkres@gsMarkerColor = colors</div><div>dum3 = gsn_add_polymarker(wks,plot,lon,lat,mkres)</div><div><br></div><div>It works, but only displays the stations with one color.</div><div>My script is the next:</div><div><br></div><div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;</div><div><br></div><div>begin</div><div>;---Open WRF output file.</div><div>  dir      = &quot;/media/usuario/TOSHIBA/WRF_alan/9km/&quot;</div><div>  filename = &quot;wrfout_d01_2010F.nc&quot;</div><div>  a = addfile(dir + filename,&quot;r&quot;)</div><div><br></div><div>;---Read terrain height and lat/lon off file.</div><div>  it        = 0     ; first time step</div><div>  hgt       = wrf_user_getvar(a,&quot;HGT&quot;,it)    ; Terrain elevation</div><div>  hgt@lat2d = wrf_user_getvar(a,&quot;XLAT&quot;,it)   ; latitude/longitude</div><div>  hgt@lon2d = wrf_user_getvar(a,&quot;XLONG&quot;,it)  ; required for plotting</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Grafico</div><div>;;;;;;;;;;;;; Salida</div><div> type = &quot;x11&quot;</div><div> ;type = &quot;pdf&quot;</div><div> ;type = &quot;ps&quot;</div><div>; type = &quot;ncgm&quot;  </div><div><br></div><div><br></div><div>  wks = gsn_open_wks(type,&quot;graficas/topografia_cuenca&quot;)</div><div><br></div><div>;---Set some basic plot options</div><div>  res               = True</div><div><br></div><div>  res@gsnMaximize   = True   ; maximize plot in frame</div><div>  res@gsnDraw       = False</div><div>  res@gsnFrame      = False</div><div><br></div><div>  res@tiMainString  = filename</div><div><br></div><div>  res@cnFillOn      = True  </div><div>  res@cnFillPalette = &quot;OceanLakeLandSnow&quot;</div><div>  res@cnLinesOn     = False</div><div><br></div><div>  res@mpProjection  = &quot;CylindricalEquidistant&quot;    ; The default</div><div><br></div><div>;---Zoom in on plot</div><div>  res@mpMinLatF     = -13.8</div><div>  res@mpMaxLatF     = -10.5</div><div>  res@mpMinLonF     = -77</div><div>  res@mpMaxLonF     = -73.6</div><div><br></div><div>;---Additional resources desired</div><div>  res@pmTickMarkDisplayMode = &quot;Always&quot;   ; nicer tickmarks</div><div><br></div><div>  res@mpDataBaseVersion     = &quot;MediumRes&quot;       ; better and more map outlines</div><div>  res@mpDataSetName         = &quot;Earth..4&quot;</div><div>  res@mpOutlineBoundarySets = &quot;AllBoundaries&quot;</div><div>  res@mpOutlineOn           = True</div><div><br></div><div>  res@lbOrientation         = &quot;Vertical&quot;</div><div>  res@tiMainOffsetYF        = -0.03           ; Move the title down</div><div><br></div><div>;---Change contour levels to better match the color map being used</div><div>  res@cnLevelSelectionMode = &quot;ExplicitLevels&quot;</div><div>  res@cnLevels = (/2,100,200,400,600,800,1000,1200,1400,1600,1800,2000,\</div><div>                  2200,2400,2800,3000,3200,3400,3600,3800,4000,4200,4400,4600,4800,5000,\</div><div>                  5200,5400/)</div><div><br></div><div><br></div><div>  res@gsnAddCyclic = False</div><div><br></div><div> plot = gsn_csm_contour_map(wks,hgt,res)</div><div><br></div><div> cuenca_mantaro_shp_name = &quot;/home/usuario/Escritorio/alan/cuencas/UH.shp&quot;</div><div><br></div><div>  lnres                  = True</div><div>  lnres@gsLineColor      = &quot;black&quot;</div><div>  lnres@gsLineThicknessF = 4 </div><div><br></div><div> can_id = gsn_add_shapefile_polylines(wks,plot,cuenca_mantaro_shp_name,lnres)</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> </div><div> 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>           &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>           &quot;forestgreen&quot;,&quot;darkorchid2&quot;,&quot;olivedrab2&quot;,&quot;darkorchid2&quot;/)</div><div><br></div><div><br></div><div>  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>           ,&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>            ,&quot;Huancavelica&quot;,&quot;Lircay&quot;,&quot;Quinua&quot;,&quot;Acobamba&quot;/)</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.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>  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.05    ;0.03</div><div><br></div><div>  txres               = True</div><div>  txres@txFontHeightF = 0.014</div><div><br></div><div><br></div><div> do i = 0,19</div><div>  </div><div>    mkres@gsMarkerColor = colors(i)</div><div>    dum3(i)=  gsn_add_polymarker(wks,plot,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> </div><div><br></div><div>  end do</div><div> </div><div> ;mkres@gsMarkerColor = colors</div><div><br></div><div>; dum3 = gsn_add_polymarker(wks,plot,lon,lat,mkres)</div><div><br></div><div><br></div><div> draw(plot)</div><div> frame(wks)</div><div><br></div><div><br></div><div>  end</div></div><div><br></div><div><br></div><div>Thanks for your time,</div><div><br></div><div>Jesus</div><div><br></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>