begin load "shapefile_utils.ncl" shapefile_name = "test_shapefile.shp" print_shapefile_info(shapefile_name) ;colors =(/"blue","white","blue"/) colors =(/"blue","white"/) wks = gsn_open_wks("png","test") ; send graphics to PNG file res = True ; Set some plot options res@gsnMaximize = True ; maximize plot in frame res@gsnDraw = False res@gsnFrame = False res@mpMinLonF = -110 res@mpMaxLonF = -75 res@mpMinLatF = 25 res@mpMaxLatF = 55 res@mpFillOn = False ; Turn off gray-filled land res@mpOutlineOn = False ; Turn off map outlines res@pmTickMarkDisplayMode = "Always" ; nicer tickmarks ;---Set some options for the polylines lnres = True lnres@gsLineThicknessF = 2.0 ; default is 1.0 lnres@gsLineColor = "NavyBlue" ; default is black ;---Create the map res@tiMainString = shapefile_name ; Main title plot = gsn_csm_map(wks,res) ;---Open shapefile f = addfile(shapefile_name,"r") dims = getfilevardimsizes(f,"geometry") print(dims) segments =getfilevardimsizes(f,"segments") print(segments) ;---Attach the test filled polygons lnres@gsSegments = f->segments(:,0) lnres@gsColors = colors id = gsn_add_polygon(wks, plot, f->x, f->y, lnres) ;---Draw everything draw(plot) frame(wks) end