12-04-2024
GraphGuy
Meteorite | Level 14
Member since
06-23-2011
- 1,445 Posts
- 375 Likes Given
- 101 Solutions
- 565 Likes Received
About
Traditional SAS/Graph Procs, and Annotate.
-
Latest posts by GraphGuy
Subject Views Posted 2104 12-04-2024 07:59 PM 1437 11-14-2024 04:04 PM 598 08-06-2024 08:02 PM 613 07-12-2024 09:11 AM 1306 07-06-2024 03:21 PM 1098 06-21-2024 10:44 AM 653 06-21-2024 10:09 AM 1266 06-21-2024 09:47 AM 4208 06-13-2024 10:50 PM 1522 04-10-2024 09:53 PM -
Activity Feed for GraphGuy
- Liked Re: Fun With SAS ODS Graphics: Matrix Plot for Ksharp. 12-04-2024 08:02 PM
- Liked Re: Is there a way to make sas studio have a background of black? for LeliaM. 12-04-2024 08:01 PM
- Posted Re: SAS color names: Why is "Blue Green" not the same as "Green Blue"? on Graphics Programming. 12-04-2024 07:59 PM
- Liked Fun With SAS ODS Graphics: Thanksgiving Turkey Crown for tc. 11-29-2024 02:13 PM
- Liked Fun With SAS ODS Graphics: Hexagon Map State-by-State 2024 Election Recap for tc. 11-29-2024 02:12 PM
- Posted Re: Fun With SAS ODS Graphics: How Many States Does It Take to Win a U.S. Presidential Election? on Graphics Programming. 11-14-2024 04:04 PM
- Liked Fun With SAS ODS Graphics: How Many States Does It Take to Win a U.S. Presidential Election? for tc. 11-14-2024 04:04 PM
- Liked Re: Is it possible to include sequentially numbered titles for plots? for Ksharp. 10-21-2024 12:13 PM
- Liked Re: Extended Pie Chart: Donut of Pie for Ksharp. 10-21-2024 12:11 PM
- Liked Re: Extended Pie Chart: Donut of Pie for Ksharp. 10-21-2024 12:11 PM
- Got a Like for Re: Need help with Annotate Arrow Function. 10-09-2024 03:52 PM
- Liked Fun With SAS ODS Graphics: Matrix Plot for Ksharp. 09-05-2024 09:02 PM
- Liked Re: On-Screen plots display correctly but saved ODS output is different for ballardw. 09-05-2024 09:01 PM
- Posted Re: Converting Latitude and Longitude for Use With Specific MAPSGFK Maps on Graphics Programming. 08-06-2024 08:02 PM
- Liked Re: picture format for time axis for Ksharp. 07-12-2024 09:13 AM
- Posted Re: Discrete Axis - Ticks at both ends when using inbetween on Graphics Programming. 07-12-2024 09:11 AM
- Posted Re: Fun With SAS ODS Graphics: Stars and Popsicle Stick Stripes Forever on Graphics Programming. 07-06-2024 03:21 PM
- Liked Fun With SAS ODS Graphics: Stars and Popsicle Stick Stripes Forever for tc. 07-06-2024 03:19 PM
- Posted Re: Difficulties getting Proc Gmap to produce annotated graph with Proc Geocode and county level map on SAS Programming. 06-21-2024 10:44 AM
- Posted Re: Editing slice labels in a donut chart so that they don't overlap on Graphics Programming. 06-21-2024 10:09 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 5 4 6 -
My Liked Posts
Subject Likes Posted 1 05-06-2022 08:25 AM 2 06-13-2024 10:50 PM 2 09-13-2023 02:24 PM 1 06-05-2023 07:01 PM 1 08-28-2019 09:46 AM -
My Library Contributions
Subject Likes Author Latest Post 0
12-04-2024
07:59 PM
If you care about your colors, and want them to look consistent no matter what type of output you're creating (png, svg, java, activex, javaimg, actximg, pdf, etc) ... I suggest always using the hex rgb color codes.
... View more
11-14-2024
04:04 PM
Is there a way to get the lines to start at zero?
... View more
08-06-2024
08:02 PM
As Jeff says, Alaska & Hawaii have been moved/projected/scaled differently from the rest of the US, in this particular map (mapsgfk.us). Therefore, there is no one/simple command that will move/project/scale arbitrary lat/long coordinates and have them line up with the map.
But ... mapsgfk.uscity has applied the same move/project/scale to all the mapsgfk.uscity locations, so they line up with mapsgfk.us ... and therefore if you find the closest city to each of your lat/long locations, you could look up the x/y from mapsgfk.uscity, and plot those locations on the map. Here's a small example showing all the mapsgfk.uscity locations overlaid on mapsgfk.us:
title "mapsgfk.us with mapsgfk.uscity locations overlaid";
proc sgmap mapdata=mapsgfk.us noautolegend plotdata=mapsgfk.uscity;
choromap / mapid=statecode;
scatter x=x y=y / markerattrs=(size=1px color=red symbol=circlefilled) transparency=0;
run;
... View more
07-12-2024
09:11 AM
Why would you want any ticks on that axis at all?
What purpose do they serve?
... View more
07-06-2024
03:21 PM
@tc never disappoints!
... View more
06-21-2024
10:44 AM
Here's how to do it without combining/projecting/separating the map & data, by using the somewhat new feature of saving the projection parameters for the map and then applying them to the annotate dataset:
data zips;
input c zip;
cards;
1 65203
2 65211
3 65201
;
proc geocode data=zips out=geocodedzips (rename=(x=long y=lat));
run;
data mocounties; set mapsgfk.us_counties (where=(statecode='MO'));
run;
proc gproject data=mocounties out=mocounties
latlong eastlong degrees parmout=projparm;
id county;
run;
proc gproject data=geocodedzips out=geocodedzips
latlong eastlong degrees parmin=projparm parmentry=mocounties;
id;
run;
data anno_locations; set geocodedzips;
if c=1 then color="red";
if c=2 then color="bib";
if c=3 then color="viyg";
if c=4 then color="bippk";
xsys='2'; ysys='2'; hsys='3'; when='a';
function='pie'; rotate=360; size=.5;
style='psolid';
output;
length html $300;
html='title='||quote(trim(left(c))||'0d'x||trim(left(put(zip,z5.))));
style='pempty'; color='deb';
output;
run;
pattern1 v=e;
proc gmap map=mocounties data=mocounties anno=anno_locations;
id county;
choro segment / coutline=black levels=1 nolegend
coutline=gray99;
... View more
06-21-2024
10:09 AM
Could you provide the code you used to produce your gchart pie chart?
... View more
06-21-2024
09:47 AM
Hypothetically, you could draw bars on a 2d map using annotate (where the bar starts at the center of each state, and the height of the bars is scaled based on the data). I'm not sure it would be a great way to present data, and not sure it would be worth the work.
... View more
06-13-2024
10:50 PM
2 Likes
Examples are a *lot* more useful, when they include the sample data!
... View more
04-10-2024
09:53 PM
The maps in the blog post show numeric (lat/long) axes - I've never seen Proc SGMAP do that. Are you 100% certain they were created with SGMAP?
... View more
04-09-2024
09:42 PM
Yep - interesting blog post. ... But it doesn't appear they used SAS to create any of the maps in the blog post(?)
... View more
04-08-2024
04:50 PM
Someone mentioned SAS/GIS - that would probably be the best SAS solution for this type of thing ... but it was never finished, and the current version of the software has been 'frozen' (no new decelopment) for many years, and it would be difficult to find expertise/advice/examples to help you with that.
You could plot lat/long crime data on streetmaps using SAS/Graph Proc Gmap, but it's a bit cumbersome (you have to download all the map tiles, and stitch them together, and then get a bit tricky to annotate your data onto the map tile images).
SAS Proc SGmap makes overlaying lat/long data onto streetmaps very simple - that's what I would recommend. I put an example in a blog that might get you started (sample code at bottom of the blog): https://blogs.sas.com/content/graphicallyspeaking/2021/08/17/cary-nc-data-fire-incidents/
... View more
03-06-2024
10:46 AM
You could use the value of the 'present' variable to control the color of the dots, such as ...
data coordinates; set coordinates;
length color $12; xsys='2'; ysys='2'; hsys='3'; when='a'; function='pie'; rotate=360; size=1.0;
if present=0 then color='red';
else if present=1 then color='green'; run;
... View more
02-17-2024
12:09 PM
Not sure exactly when it was upgraded, but looks like it's at 9.4m7 now (Feb 2024) ...
%put &=SYSVLONG;
SYSVLONG=9.04.01M7P080620
So a bunch of the last features added to sgmap should work now:
https://blogs.sas.com/content/graphicallyspeaking/2020/09/25/new-sgmap-features-in-sas-9-4m7/
... View more
02-17-2024
10:31 AM
I have a couple of similar examples on this page, that might interest you. (they're on the last row of thumbnails - bottom/left):
https://robslink.com/SAS/democd_mpg/aaaindex.htm
... View more