gsn_polygon

From: Michael Notaro <mnotaro_at_nyahnyahspammersnyahnyah>
Date: Wed, 21 Jan 2009 11:51:38 -0600

I am having a problem using gsn_polygon.
I am trying to plot a polygon with 8 points, listed
below. Here's the end of my code, the plotting section.
Instead of a small polygon, the entire map turns black.
I suspect I am making a tiny mistake and not noticing.
Any idea what I did wrong? These lats/lons should
work to produce a reasonable polygon shape.

Mike

   wks = gsn_open_wks ("ps", "generic_map")
   plot=new(1,graphic)
   setvalues wks
     "wkColorMap" : "BlWhRe"
   end setvalues
   res = True
   res_at_gsnFrame=False
   res_at_tiMainFontHeightF = 0.033
   res_at_tiMainString = "Plant Distribution"
   res_at_tmYROn = False
   res_at_tmXTOn = False
   res_at_mpOceanFillColor = -1
   res_at_mpLandFillColor = -1
   res_at_mpMinLatF = 10.
   res_at_mpMaxLatF = 75.
   res_at_mpMinLonF = -180.00
   res_at_mpMaxLonF = -50.00
   res_at_mpCenterLonF = -115.
   res_at_mpOutlineBoundarySets = "AllBoundaries"
   res_at_mpGeophysicalLineThicknessF = 2.5
   res_at_mpOutlineOn = True
   plot = gsn_csm_map(wks,res)

   res1=True
   res1_at_gsFillScaleF = 1.0
   res1_at_gsFillColor = "forestgreen"
   lat1=lat(15,0:pts(15)-1)
   lon1=lon(15,0:pts(15)-1)
   lat1!0="lat"
   lat1_at_units="degrees_north"
   lat1&lat=lat1
   lon1!0="lon"
   lon1_at_units="degrees_east"
   lon1&lon=lon1

   print(lat1)
   print(lon1)

   gsn_polygon(wks,plot,lon1,lat1,res1)

   frame(wks)

------------------

Variable: lat1
Type: double
Total Size: 64 bytes
             8 values
Number of Dimensions: 1
Dimensions and sizes: [lat | 8]
Coordinates:
             lat: [54.4126815796..54.4126815796]
Number Of Attributes: 2
   _FillValue : -999
   units : degrees_north
(0) 54.4126815796
(1) 54.4171485901
(2) 54.4163818359
(3) 54.4119338989
(4) 54.4063796997
(5) 54.4074935913
(6) 54.4108200073
(7) 54.4126815796

Variable: lon1
Type: double
Total Size: 64 bytes
             8 values
Number of Dimensions: 1
Dimensions and sizes: [lon | 8]
Coordinates:
             lon: [-130.6879730225..-130.6879730225]
Number Of Attributes: 2
   _FillValue : -999
   units : degrees_east
(0) -130.6879730225
(1) -130.674041748
(2) -130.6725158691
(3) -130.6683349609
(4) -130.6688842773
(5) -130.6794433594
(6) -130.686126709
(7) -130.6879730225

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 21 2009 - 10:51:38 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 21 2009 - 13:09:22 MST