Main

August 21, 2007

Maps for Scientists: Using

You’ll usually be wanting to work with maps that are EPS graphics, which are the standard for the publishing industry. If you have a Windows Metafile (.wmf), it’s fine for editing inside Word or PowerPoint (here’s a tutorial) but not much else. Personally I prefer to work with EPS files and export them as GIF images when I need to use them in a PowerPoint show. The workflow below is for Illustrator, but other vector graphics packages should work similarly.

maptextfile.gifYour map may start off in PostScript or Illustrator format. PostScript is a language used to define the lines and curves that make up vector graphics; a PostScript file looks like an ordinary text file, and indeed you can open it with a word processor, although it’s scarcely enthralling reading. Once you open it in Illustrator or any other vector graphics program that speaks openmaptextfile.gifPostScript, it will display as a series of shapes with lines and fills. It’s also possible to buy maps already saved in Illustrator format, which allows them to have complex layering and makes them easier for you to edit. Older Illustrator maps will need to have their fonts updated when you open them in Illustrator CS; this is an option you’re given when you first open them, and there’s no going back. Use Save As to make a working copy of the original. Of course, you should be using Save As all the time anyway to make multiple working versions of any graphic you’re editing. Go on, you’ll thank me one day.

northatlantic1.gif

If the graphic has layers, turn off or delete the ones you don’t want. If it doesn’t have layers, similar objects (land, sea) are probably arranged in groups, so you can select them all with a single click. Sometimes, though, there are just too many points on a complex path (for example, a detailed coastline) for it to be a single Illustrator object. If that’s the case, and the things you want to change are tiled or split into several groups, you have two choices. You can shift-click to select multiple objects, or you can do a Select > Same (for example, Same > Fill Color) to catch everything sharing the properties of what’s already selected. This is useful for catching every last one of a cloud of things like rivers or placenames if they’re not handily grouped.

selectsame.gif

When you have a group of objects selected, I’d recommend converting them to grayscale, since most maps you make will have to be reproduced in black and white at some point. You can pick a color model from the popup menu in the Color palette. (You know those little triangles popup.gif are popup menus, don’t you? Not everyone does.) Make sure the shades of gray are far enough apart to remain distinctive after printing or photocopying (perhaps at least 20%), and avoid less than 15% or greater than 85%, as these will degrade to solid white or black after a couple of rounds of photocopying. In this map, the pale blue ocean converted to 9% Black when I switched to grayscale, so I bumped it up to 15%.

northatlantic2.gif

If you don’t need all the layers in an object, you can delete them, but sometimes you’ll just want to hide them in case they’re needed one day. These invisible layers are still included when you send something to the printer or export it as an EPS, which can have a big effect on file size. To keep an invisible layer available but not have it included when you print or export, uncheck the Print checkbox in the Layer Options dialog, which is in the Layers popup menu.

layeroptions.gif

Many of the shapes will have a line and a fill, and you almost never need both. Remove unnecessary lines; I set the lines of latitude and longitude to white, and eliminated the black box around the whole map. I selected the lakes and made their line and fill the same 15% Black as the ocean, then changed the rivers to make them blend in with the land (so they don’t show up, but don’t leave gaps). The countries now have a 60% stroke and fill; turning off the stroke left some gaps along state borders, so I just set it to the same color as the fill. I deleted the placenames, and changed the color of the coastlines to 60% Black again.

northatlantic3.gif

It’s perfectly possible to simplify things further, of course. Feel free to eliminate lines and labels and fade back land and sea as required to make your point. To crop away parts of the map you don’t want, draw a box over the desired portion (this needs to be the topmost object), select everything, then choose Crop from the cropmap.gif Pathfinder palette. This will trim away everything outside the boundaries of the topmost object. (Remember to save a backup version!) For the map below, I’ve added a colored shape with a Gaussian blur, and used the Brush tool with the Arrows brush library to draw the currents. Clicking on an arrow with the text tool turns it into a path for labels to march along.

northatlantic4.gif

You can now use Save As to create an EPS for print publication, or Save For Web if you want a GIF or JPEG (the former is probably a better choice with maps) for PowerPoint or the Web. Remember, if you’re using color make sure it’s CMYK if the map’s for print, RGB if it’s for a computer screen (another reason why we save multiple versions…) There’s plenty more we could say about map editing, so feel free to mail me tips or queries, or comment below.

August 14, 2007

Maps for Scientists: Choosing

If you’re creating a map, you’re best to start with an illustration in vector, not bitmap, format (unless of course it’s an aerial photograph)—you want to be able to scale it, make global changes to simple color schemes, hide and show layers containing place names, distributions, and the like, and keep the file size relatively small and the resolution high. All this is what vector graphics are designed for.

Most vector maps commercially available will be EPS files, though PDF is becoming more common; Illustrator can read them both. There are any number of map art vendors on the web; Map Resources and Digital Vector Maps are typical. Expect to pay $50 or more for a single map, and several hundred dollars for a CD with a selection of them. It’s worthwhile for a whole department or lab to invest in a full set of countries of the world, plus globes in a variety of projections, but this is often too expensive for an individual. There are very few places where you can get inexpensive quality vector maps online; here are two.

National Geographic’s website gives away world and country map, with placenames or just plain vanilla, in PDF format. Illustrator can convert these and open them, though you probably don’t own the fancy fonts that National Geographic uses, so it will substitute Arial or somesuch. It’s not too difficult to select and edit the fonts, though. The maps are plainly marked as copyrighted, though modifying them for non-commercial purposes would seem to be allowed under Fair Use provisions. They’re being given away explicitly for educational use, after all.

iStockPhoto has an enormous amount of artwork available very cheaply; a basic cartography search brings up a bunch of globes, and you can search more specifically for Mollweide and so on. Most cost around a buck. This is an excellent site for quickly finding quality images of any kind, especially generic advertising photography useful for illustrating brochures and blog postings; it’s worth bookmarking and buying a bunch of credits just in case you need a cheap photo in a hurry.

natgeo_istock.jpg

The next big decision is choosing an appropriate map projection. The Earth is a sphere and paper is flat, so any representation of the planet has to distort something. Distances, shapes, or areas: what gets distorted depends on what you want to use the map for.

Regardless, rectangular world maps are generally bad. The traditional Mercator projection (which radically distorts sizes), and the Peters projection (which distorts shapes and distances) should both be avoided. The Mercator is designed for sailors plotting a compass bearing, but isn’t much good for anything else. Because it overemphasizes polar area, it has to be cropped to not look silly, and the Southern hemisphere usually comes off worse in the cropping because, well, there’s less stuff down there (it’s really not an insidious plot by European mapmakers). The Peters projection is a political rebuttal to the Mercator, but in keeping relative land area equal it sacrifices everything else. Peters didn’t invent equal-area maps; there are many different one, going back to the 19th century, and the Peters version is by no means the best, though it’s certainly the most controversial; see the discussion in Monmonier (2004).

mercator_peters.gif

If you allow the poles to contract a little, and depart from a rectangle, you distort relative sizes far less. The Robinson projection was adopted by the National Geographic as a good general-purpose world map, and later replaced by the Winkel Tripel projection. For most of us, as long as you avoid rectangles, it doesn’t make much difference which projection you use (there are plenty more available, all different solutions to fitting a sphere on a page).

robinson_winkel.jpg

Here’s another one. The Mollweide is one of a number of projections that preserves relative area, but in the process distorts shape. One way to reduce the distortion is to interrupt it at the oceans (assuming, of course, you’re not interested in oceans). These orange-peel interrupted maps come in many different variations, and should be used more widely. I’ve never seen one for marine biologists, carving up land masses so as to accurately portray the oceans, but it must exist.

Mollweide-interrupted.gif

If instead of portraying the whole planet you only want to focus on one area, a planar projection might be better. The usual ones we see are the round maps of the North or South poles, but they can be centered on any part of the world; they’re most accurate in the middle and become progressively more distorted as you reach the edges. In the past I’ve used Antarctic planar projections to depict the breakup of Gondwana and the circumpolar distribution of the ratites. If you’re buying a set of maps, make sure it comes with a good variety of planar projections (usually just categorized as “globes”), including one centered on your area of interest.

globes.gif

References: Map projections are of course well covered in Wikipedia and a little more accessibly on this page. Also check out Flattening the Earth: Two Thousand Years of Map Projections by John P. Snyder (University of Chicago Press, 1997 new ed.) and Rhumb Lines and Map Wars: a Social History of the Mercator Projection by Mark Monmonier (University of Chicago Press, 2004).

August 5, 2007

How to Silhouette

If you’re a biologist, having an nice representative outline of your study organism is very handy, especially if it can be scaled to any size without losing sharpness, while remaining svelte enough to attach to an email. If you know your graphic formats, I’m talking about Encapsulated PostScript, or EPS, the vector graphics format that Illustrator and other drawing programs use. Unfortunately, most of us only have photos or sketches of our organisms, in a bitmapped format like TIFF or JPEG. How do we go from one to the other? In March of the Ratites, I briefly discussed how to make an EPS silhouette, but here’s the step by step version.

pentool.gifYou’ll start in Illustrator, Freehand, or any other drawing program that has a pen tool. If you’re new to Illustrator, learning how to use the pen tool to create and edit paths is very strongly recommended: there are pen tool tutorials here, here, here, and here. Here’s a cheat sheet.

Start with a photo. Google’s Image search is good; large images are best. You’re looking for a view from the side with good strong edges. If you’re working from a fuzzy sketch or indistinct picture, print it large, color it in with a magic marker, and scan it back in. It’s also possible to find a few images and composite them together in Photoshop, as I’ve done below. (I was just at the University of Queensland, where these big ugly megapodes, called Brush Turkeys (Alectura lathami) steal food from cafeteria tables.)

brushturkey.jpg

layer.gif File > Place the photo or scan in an Illustrator document. You may want to double-click the layer, lock it, and set its opacity to 50% if you’re planning to trace round it. If you choose the Template option when placing it, Illustrator will do exactly that for you. Create a new layer to draw on.

strokefill.gif Choose the Pen tool, set the stroke to solid and the fill to none, and start clicking your way around the outline. Press down to drag out Bézier handles when you want a curve; you can adjust the exact curvature later. Most of your points will be curves; for the few acute or obtuse angles you can just click to make a corner point. If you make a mistake, choose Undo. When you get all the way round, click on your starting point to close the curve. It took me about five minutes to work my way around the Brush Turkey, and that was using a laptop trackpad. A mouse is far easier, and a graphics tablet better still—even a small graphics tablet, like the Wacom Graphire (look for a used older model) is a worthwhile investment if you plan on making a lot of information graphics.

addingpoints.jpg

Once you’ve finished the outline, switch to the Direct Selection tool, zoom in, and start adjusting the points and curves. Reposition the points, and lengthen/shorten/reposition the Bézier handles until the outline matches the photo. You don’t have to get it perfect, as the silhouette will usually be printed quite small. Use the cheat sheet or tutorials above to learn how to add and remove points and change them from curve to corner.

editingpoints.jpg

Hide the background layer, set the Fill to black, and check the overall look. You may find some weirdness where you’ve accidentally clicked too many times or dragged the wrong way; you can usually fix this by zooming in very close and removing unwanted points (by clicking on them with the Pen tool).

If you’re happy, save a just-in-case backup Illustrator file (with the .AI extension), delete the background layer, and use Save As to make an Illustrator EPS (probably best to make it CMYK with a black-and-white TIFF preview; if this is Greek to you, check out my handout on graphics formats). You can still edit the EPS in Illustrator, but it’s a common file type that can be understood and imported by most page layout and image editing programs. Because it’s a vector graphic, you can also resize it without changing the resolution, and the file size is a bit smaller: mine is 368K, a third the size of the original photo. Once you’ve made a few silhouettes, you’ll find a myriad of uses for them, from labelling phylogenies to tagging graphs to sprucing up your grant proposals and letterheads. Enjoy.

brushturkeysilhouette.gif

Many thanks to David Booth and Yvonne Eiby for chatting with me about Brush Turkeys, and to the University of Queensland’s Department of Integrative Biology (particularly Cynthia Riginos and Lyn Cook) for sponsoring my visit.

February 28, 2007

Mike’s Tip List

I was asked to come up with a list of data presentation tips for scientists; here’s the result. Distilling one’s philosophy down to bullet points is an exercise I recommend. Not much of the following will be news to regular readers of this site, I suspect, but feel free to pass it on. Or draw up your own, and send me the link.

bigmike.jpg

  • Sketch out ideas on paper first, before you turn on the computer. All graphics used to be drawn by hand. Software reduces creativity; good graphics are created despite your software.
  • People will look at your pictures before they read your text, if they read it at all. Graphics have to be self-contained. Put your conclusion right there in the caption.
  • The graphic has to tell a story (if it doesn’t, don’t use it) and your job is to keep redesigning it until the story is as clear as possible.
  • Show the actual data, as much as you can. People can deal with much greater information density than you think. Your job is to help them see the patterns in the data, but…
  • Show as little non-data stuff as you can. Remove boxes, lines, colored backgrounds, grids, shadows, and other decoration, except where it’s essential to understanding the data. If you can’t remove it, fade it out or make it smaller, thinner, or dotted.
  • Minimize the number of steps required to interpret your graphic. Don’t put required information in the text that could go in the caption, or in the caption if it could go in a key, or in a key if you could just label the points or lines directly.
  • Avoid color; it disappears on photocopying or printing. Use contrasting thicknesses, tints, line styles or shapes first, then color. Your graphic must work in black and white.
  • If you use color, use an intuitive scale that relates sensibly to your data, not all the colors of the rainbow. Make sure colors vary in intensity, not just hue, and remember some of your readers will be color-blind.
  • Provide context. Always use a scale and give sources. Six small, related graphs juxtaposed in the space we’d usually use for just one provide more than six times as much content.
  • Learn some basic typography, Illustrator, and Photoshop. It’s not hard to find tutorials, and they’re wonderful transferable skills.
  • Never print out your slides. Give people a handout with your contact details, a couple of graphics or tables (including any too detailed for a PowerPoint slide), your conclusions, and a bibliography.
  • Don’t make lists of bullet points, like this one. Show, not tell.

Manifestos are great for removing nuance and blurring away contention, aren’t they? That’s why they’re so satisfying to write.

June 26, 2006

Better Axes

A good rule when making graphs is to remove needless impediments. Every extra act of interpretation we ask of the reader is a chance for them to misunderstand, be baffled, or get frustrated and move on. There should be as little standing between the reader and the data as possible. One level of interpretation all readers have to grapple with is the humble axis; here are some guidelines.

Label directly

If you can, put units right there on the axis, not on the axis label. In general, getting information out of the label and caption and putting it on the graph where people can see it a good idea.

axes1.gif

(By the way, that’s a real degrees sign above; all fonts have one. See Robin Williams for tips on finding it and other special characters. Never try to fake it with a superscripted o!)

Rotate for readability

axes3.gif

All the graphing software I know generates vertical labels on the y-axis by default, but these are really almost unreadable. It’s a good idea to make them horizontal wherever possible, moving them to the top if there’s no space to the left.

I’m also a fan of getting axes out of log form. Real units are what we’re used to reading, and forcing people to calculate antilogs in their head increases the risk they’ll misread your numbers. We’re pretty terrible at comparing logarithmic values as it is, so it’s almost deceptive to hide them behind a linear axis.

When you expand units to make them comprehensible, they do take up more room. (For example, see below. But who doesn’t understand what Ma means, I hear you ask? Well, your mother, administrators, your congressman, journalists, and the voting taxpayers or undergraduates who pay your salary perhaps.) One solution is to rotate them a little: -30° in this case. It’s also possible to make the axis smarter; why not show geological periods, for example?

axes2.gif

Use sensible units

If you’re using non-decimal units for some reason don’t use a decimal scale, even if it seems more “scientific”. Why make needless work for the reader?

axes4.gif

(The foot and inch marks used here, by the way, are the prime marks, not the typewriter quotes next to the semicolon key—see Robin Williams again.)

When we count days, we think in months and years, not base 10. If you turn the scale into a calendar, it no longer needs a silly axis label like “day of year”. Of course, always identify months with a word or roman numeral, because 01/05/06 can mean Jan 5 or May 1. We’re all used to reading calendars, so a detailed scale is fine—note that a sufficiently-detailed one doesn’t need an axis line.

axes5.gif

You Don’t Have to Start with Zero

axes6.gif Honestly. In some cases, it’s just meaningless, as there is no “value zero” to graph, such as with the days to the right. And having the y-axis pass through 1 means a data point might get tangled up with the tick marks on the axis, so there’s no reason not to leave a small gap.

There are also cases where beginning at zero would add pointless empty space to the graph; consider how little trend we’d be able to see if the graph on the right’s y-axis went from 0 to 110. So the answer is to eliminate empty space from the axis as much as possible without being actively deceptive.

William Cleveland, in The Elements of Graphing Data, often allows the scale to continue below zero, to “avoid interference” between the perpendicular axis and any zero-value data; he uses a dotted reference line to stand in for the dropped axis. Unfortunately, in the following graph this implies that ozone could exist in a concentration of less than zero parts per billion! The space below the reference line is in fact a misleading and uninhabitable no-man’s land.

axes7.gif

Leaving a gap so points don't hit the axis is OK, but extending the scale implies data values also continue. These days, with a better color palette, data on the axis no longer has to be a problem. Giving data points a thin white stroke allows them to intersect lines (and each other) while remaining visible; a little better than the jittered circles Cleveland was forced to use. (In the above makeover, you can see I also added units to the axes, rescued the labels from that horrible ALL-CAPS computer font, and condensed the empty space.)

Comments and suggestions welcomed, as always.

June 4, 2006

The Graphical Octants

At a recent all-day workshop devoted to information presentation, some bright sparks dreamed up three axes along which you can position any information graphic.


octant.gif
 

We normally just assume the noviceexpert distinction is a function of how qualitative or educational a graphic is, so I strongly support putting it on an independent axis. Both novices and experts need exploratory graphics, that let them find patterns in the data, and educational ones, intended to make a point. These could equally be quantitative, where every data value could be read off, or qualitative, showing general patterns.

Three variables make a three-dimensional space divided into eight cubical sectors; technically, octants (though everyone at the meeting, shamefully, was calling them quadrants).

Which octant is your graphic in? Now what would the other seven versions of it look like? This is a good exercise, because it makes you realize there isn’t one “best” solution to a design problem, something we can forget if we read too many makeovers (including the ones on this site). It’s a good mental exercise, for you and your client, to try shifting graphics along just one axis, so you can put your finger on exactly which elements are doing which job.

Of course, heuristics like these octants are just mental tools, not the Revealed Truth. For example, are we sure these axes necessarily represent mutually exclusive goals? In the best graphics, it’s possible to display all your data quantitatively, yet still discern overall qualitative trends. Perhaps we could challenge ourselves to make graphics that are comprehensible to lay people (which includes almost everybody, even experts from disciplines just outside yours) while containing levels of richness for the informed; avoiding needlessly technical language and conventions would be a start. And a sufficiently well-crafted graphic would let people find more patterns than just the ones we want them to see, perhaps ones we hadn’t even noticed. How about as a goal for the year trying to span multiple octants? (Now that would make a befuddling bumper sticker.)

May 7, 2006

Fixing Excel’s Charts

Everyone makes fun of Excel, but sometimes it’s all you have. How can we fix its dreadful graphs?

Here’s a data set showing the male and female body masses in kilograms of the ratite birds. Let’s graph it as a scatter plot. (You can download the Excel file and follow along if you like).

excel1.gif

There are a few things we can fix while in the Chart Wizard.

  • Type in sensible axis labels and title.
  • Turn off the gridlines (or, if they’re absolutely necessary, make them pale gray and dotted.)
  • Turn off the legend, since we only have one data series.

excel2.gif

Once the chart is placed on the page, this is what you get. Still a lot of work to do, isn’t there? Time to start double-clicking on various elements and altering them.

excel2b.gif

  • Give the plot area no fill and no line, instead of default gray.
  • Format line color and thickness of each axis; paler and thinner never hurts.
  • Manually choose the best minimum and maximum numbers for each axis scale to minimize waste space. I made the maximum x-axis value 120.
  • Change the font for each axis to something readable, turning off auto-scale, that very annoying feature that makes lettering unreadable if you shrink the chart..
  • Adjust the font and size of all the labels, again turning off auto-scale. I made the heading in Hoefler text plain—bold tends to be over-used in non-professional design, and in fact plain text is often more striking for headings. Georgia is a good alternative to Hoefler Text on Windows machines. Trebuchet in two sizes was used for the axes, since it’s narrow and contrasts well with the heading. Pick the labels up and move them where you need them.
  • Select the y-axis title and change the alignment so it’s rotated 0°. Insert line breaks as needed to make it narrower.
  • Select the data points, turn off the default shadow, and use a foreground or background color (the Excel equivalent of stroke and fill); you’d rarely need both. Adjust size or shape as needed.
  • Start tweaking. Here I resized the plot area so both axes used the same scale (I needed to turn off the x-axis's auto-incrementing). Drawing a square with the drawing tools (shift-rectangle) tu use as a temporary guideline helps get the intervals on each axis the same. I also added a y=x line and text label with the drawing tools.
  • The next step would be to shift the units to the axes, by floating a “kg” text box next to each one, and then label some of the interesting outliers, such as ostrich and giant moa, with more text boxes. While it’s certainly possible to do all this in Excel, it would be more sensible at this stage to shift to a vector graphics program like Illustrator, and use it to make a self-contained EPS graphic.

So that’s a checklist of steps that can easily improve an Excel chart. Below is the cleaned-up version and the Excel default (note what auto-scale did to the labels when I resized the default chart!)

excel3.gif

Too much work to do to every graph? I agree. A future posting will provide some already-cleaned-up templates you can download and install.