I am using PROC SGMAP to spatially plot locations of air-bnbs in San Francisco. I am trying to color code the points based on reviews (i.e. red=poor, yellow=standard, and green=excellent). Using this code: proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run; I am able to produce a plot with the default colors: I have tried using style modification: proc template;
define style MyStyle;
parent = Styles.Listing;
/* Attempt to change to different colors */
class GraphData1 / contrastcolor = GraphColors('gcdata4');
class GraphData2 / contrastcolor = GraphColors('gcdata5');
class GraphData3 / contrastcolor = GraphColors('gcdata6');
end;
run;
ods listing style=MyStyle;
proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run; and %Modstyle: %modstyle
(name=MyStyle
,parent=Listing
,type=CLM
,colors=cx543005 cx9D3CDB cx7F8E1F
);
ods listing style=MyStyle;
proc sgmap plotdata=checkout.airbnb_SF;
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run; However, the default colors do not change. Using STYLEATTRS yields an error that the "Statement is not valid or it is used out of proper order": proc sgmap plotdata=checkout.airbnb_SF_Train;
STYLEATTRS DATACOLORS=(green, yellow, red);
ESRIMAP URL = 'https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer';
scatter X = longitude Y = latitude / group=score_class markerattrs=(symbol=circlefilled size=5) transparency=0.6;
run; I also tried using an attribute map, but proc sgmap did not like the inclusion of dattrmap=<my attribute map>. I'm at a loss of what else to try to change the color defaults.
... View more