/*--Project the map data--*/ proc gproject data=maps.states(where=(density<3 and (state =37))) out=ncp; id state; run; /*--Add closing line segment to each segment--*/ data nc; set ncp; retain x1 y1; keep state segment x y; by segment; /*--Save first vertex for each segment--*/ if first.segment=1 then do; x1=x; y1=y; output; end; else output; /*--Append first vertex as last point for each segment--*/ if last.segment=1 then do; x=x1; y=y1; output; end; run; /*--Map with scatter plot--*/ ods graphics / reset width=5in height=3in imagename='Map_SGPlot_Scatter'; title 'North Carolina'; proc sgplot data=nc; scatter x=x y=y / markerattrs=(size=3 symbol=circlefilled); xaxis display=none; yaxis display=none; run; /*--Map with series plot--*/ ods graphics / reset width=5in height=3in imagename='Map_SGPlot_Series'; title 'North Carolina'; proc sgplot data=nc tmplout='c:\mapGTL.sas'; series x=x y=y / group=segment lineattrs=graphdatadefault(thickness=2 pattern=solid); xaxis display=none; yaxis display=none; run;