How to Create a 'Pretty' Map with SAS


I usually create very technical maps, to display data spatially -- and they usually have a certain look. They're clear, crisp, and to the point. I typically only use color to represent the data, and I choose a font that is simple and easy to read (such as arial). But occasionally ... every so often ... you might need to create a pretty map. This example shows some tips and tricks that might help.

Let's start with a basic county map of Maryland. I have subset it from the mapsgfk.us_counties map, and used Proc Gproject to 'straighten' it. (When you subset a map, if you don't re-project it, it can look 'crooked,' since the original map was projected and centered more on the center of all the US states.)

Next, I assign each county to a region, and color the counties by region. In my technical maps, I would typically use colors that are easier to distinguish ... but this time we're going for a pretty map, where all the colors look nice together.

Next, let's use Goptions Cback=cxCCCC99 to assign a pleasant color to the background of the map. It's really nice to be able to use hex RGB codes to specify the exact color you want!

The map polygons still seem disjoint from the background, so let's use a little trick to get them to blend together. You can use Gmap's Coutline= option to set the outline color of the map areas to the same color as the background. Now we've got happy outlines around the map areas - I think I might be channeling Rob Ross! ;-)

Next, let's add some text. Rather than using a title statement, which would place the text at the top/north edge of the map, let's use annotate so we can place it wherever we want. For example, let's put 'Maryland' in the big open space at the bottom/left of the map. I tried to pick pretty fonts - something that's a bit curvy, but still easy to read.

And for a finishing touch, how about a fancy 'North' arrow ... I annotate a thick line, and then an arrow head at the top, and a fancy dark letter 'N' (for north), with a lighter gray copy of the same letter slightly offset behind it to give a 3d shadow effect.

Wow - what a beautiful map! And if you click the image above, you can see the interactive version, it has html mouse-over text and drill-downs to the Maryland Department of Natural Resources page. Perhaps you can use this map to plan your next vacation in Maryland!

This content was reposted from the SAS Learning Post. Go there to view the original.

Robert Allison, The Graph Guy!, SAS

Robert Allison has worked at SAS for more than 20 years and is perhaps the foremost expert in creating custom graphs using SAS/GRAPH. His educational background is in computer science, and he holds a BS, MS, and PhD from North Carolina State University. He is the author of several conference papers, has won a few graphic competitions, and has written a book calledSAS/GRAPH: Beyond the Basics.

Airlines Involuntarily Bumping Passengers: A Look at the Data

Airlines bumping paying passengers is an issue that has gotten a lot of attention recently. Here's a visual representation of how often it happens.

Let's Analyze 32 Years of Basketball Tournament Data!

What makes March Madness basketball data analytics even better? A great visualization.


Re: colors
  • 2/19/2017 8:11:29 PM
NO RATINGS

Looks good Robert.  I also like to remember that some of the people reading my work may be near sighted or color blind so I design things accordingly.

Re: colors
  • 2/17/2017 11:10:32 AM
NO RATINGS

Thanks for the link, Robert.

Re: colors
  • 2/17/2017 10:10:02 AM
NO RATINGS

I picked the colors to try to match the original on the Maryland website (which is long gone now). Here's a link where you might can view the original map, via the 'wayback machine' archives ...

https://web.archive.org/web/20070108222849/http://www.dnr.state.md.us/mdmap.html

 

Re: colors
  • 2/16/2017 1:25:17 PM
NO RATINGS

BTW you can check out some vintage infographics from a rather surprising source hereprintmag.com/article/hand-drawn-infographics-w-e-b-dubois/?utm_source=t.co&utm_medium=referral&utm_campaign=pr-cbu-tw-170216-The%20Hand-Drawn%20Infographics%20of%20W.E.B.%20Du%20Bois

"These infographics first appeared in Du Bois' exhibition, "The Exhibit of American Negroes," which he presented at both the First Pan-African Conference in London and the Paris Exposition. According to The Public Domain Review, the exhibition featured hundreds of photographs, patents and books by African Americans, a statuette of Frederick Douglass (who, contrary to some current belief, had passed away five years prior), as well as 58 hand-drawn infographics visualizing African American populations, occupations, places of origin and more."

colors
  • 2/13/2017 10:48:41 AM
NO RATINGS

Muted paletter to suggest the outdoors? You could have gone for higher contrast by juxtaposing colors from different color families, but this is more the color of earth and trees.

INFORMATION RESOURCES
ANALYTICS IN ACTION
CARTERTOONS
VIEW ALL +
QUICK POLL
VIEW ALL +