scatter-plot-17

How to Make a Scatter Plot in Illustrator

Scatter plots are a great way to show correlation between two variables. They’re extremely easy to create in Google Docs, Microsoft Excel, and Open Office. If you want to go beyond the limited styling that those applications allow, you might consider creating your scatter plot in Adobe Illustrator. But, making a scatter plot in Illustrator is a little less intuitive than these other applications.

Note: I’ve created a downloadable PDF of this tutorial that is available on Digital Splash Media.

The Scenario

I’ve been working on an infographic about the 2012 Major League Baseball season that compares data and shows correlations of aspects of the games to wins, for example how well a teams’s home runs, or hits, or ERA, or payroll correlates to wins. So for this example, I’ll show how to create a scatter plot that shows the correlation of team payrolls to wins for the 2012 season.

scatter-plot-dataStep 1 – Get the Data

The first thing you’ll need of course is the data. For my project, I culled data from a variety of sources and input it into a Google Docs spreadsheet. In this example, I want to show the correlation of each team’s payroll to its total wins for the 2012 season. So, I’ll be working with data from these three columns; Team, Payroll in Millions, and Wins.

Step 2 – Get the Data into Illustrator

The next step is to get this data into Illustrator. In an Illustrator document, find the scatter graph tool as shown below. You may need to hold down your mouse button as you hover over the graph tool icon to see the list of available graph tools. Select the scatter graph tool.

Scatter-Graph-Tool

 

Once the scatter graph tool is selected, click and drag with your mouse, a rectangular area on the canvas where you want your scatter plot. When you release your mouse button, Illustrator will insert the graph axes, along with a dialog box for you to insert your data.

scatter-plot-1

The next step is to insert your data into the Illustrator pop up window that looks like a spreadsheet. This is where Illustrator can be a bit quirky. You only want to insert the numerical data. In other words, don’t insert the column titles (Team, Payroll in Millions, Wins). It’s also important to consider what data you want on which axis. I’m correlating payroll to wins so I want wins on the vertical axis and payroll on the horizontal axis. So, go to your spreadsheet program where you have your data and select the data you want on the vertical axis and copy it. In my scenario, it’s wins. Remember, don’t select the cell that says “Wins.” Now go back to Illustrator select the top left cell in the pop up window and paste the data.

scatter-plot-2

Now, back to your spreadsheet and select and copy the data you’ll have on the horizontal axis. In my scenario, this is payroll in millions. Then paste that into the next column in Illustrator’s pop up window.

scatter-plot-3

Now, select the little checkbox in the top right corner of the pop up window, and when you do, Illustrator will create your scatter plot. It’s going to look a bit odd, but we’ll get to that.

scatter-plot-4

In the image above, Illustrator has made its first attempt at the scatter plot. You’ll notice that it has connected all the dots with lines. So, the next step is to style the scatter plot.

Step 3 – Styling a Scatter Plot in Illustrator

Close Illustrator’s pop up window by clicking on the little red dot in the top left corner of the pop up window. You may have to have the selection tool selected in order for this to work. Notice in your Layers window that the whole scatter plot is a graph object. In order to do any styling of the graph, you’ll need to ungroup the graph. With the graph select go to Object > Ungroup (or Cmd + Shift + G on a Mac, Ctrl + Shift + G for PCs). Illustrator will give you a warning. Click Ok.

scatter-plot-5

Now the initial graph has been ungrouped and you’ll see in your Layers window that there are four separate groups – a group for the dots, a group for the lines, a group for the x axis, and a group for the y axis.  Click somewhere on the canvas to make sure you have nothing selected. To get rid of the lines, select the lines group then hit the delete key. If you accidentally had the whole graph selected, just Undo and try again.

scatter-plot-7

Now you should have just the points and the axes on your canvas and only 3 groups in your Layers window – a group for the points, a group for the x axis and another for the y axis.

scatter-plot-8

You’ll notice that by default, Illustrator created the “points” of the scatter plot as squares. You’ll probably want circles instead, and there’s a pretty quick and simple way to change that. Select all of the points, either by selecting on the canvas or selecting the group in the Layers window. When they’re all selected, ungroup them all by going to Object > Ungroup (or Cmd + Shift + G on a Mac, Ctrl + Shift + G for PCs) as many times as needed until you see each point as an individual path in your Layers window.

scatter-plot-9

Now go to Effect > Convert to Shape > Ellipse.

scatter-plot-10

In the pop up window, click Absolute and enter the width and height of your circle. In my example I entered 10px for each to make it a perfect circle. Click OK.

scatter-plot-11

While you’ve still got all the points selected deselect the stroke color if you don’t want the circles to have a stroke.

scatter-plot-12

Now you can change the color of each individual point if you wish. If you’d like to style the each axis, it’s easiest if you select each of the axis groups and, once again select Object > Ungroup (or the corresponding keyboard shortcut) as many times as needed to get the individual elements.

scatter-plot-13

Here’s the same plot after changing the font, size and color of the axis elements and changing the colors of the dots. I wanted to focus on the ten teams that made the playoffs so I colored those teams in red and changed the rest to gray.

scatter-plot-14

Now, the scatter plot is looking pretty good and it’s doing its job of showing the correlation, or lack thereof, of payroll to wins. But what if we want to label each of the dots of the graph so we can know which teams fall where? Well, unfortunately I haven’t found an easy way to do this, so I’ve come up with a rather tedious solution of identifying who each dot represents back in my spreadsheet program then finding the corresponding dot in illustrator and labeling it manually. Here’s what I mean.

scatter-plot-15

Over in Google Docs, I can hover over each point and it will display the data for that dot. In the image above, I hovered over the top left dot to find the data for it, $56.37 million and 94 wins, then looked in the columns to find that that corresponds to the Oakland Athletics. So, then I can go back to Illustrator, find that corresponding dot and label it manually by adding text by it.

scatter-plot-16

Lather, rinse, repeat to label as many of the dots as you’d like, until you’re happy with the result. Here’s my result, one of many scatter plots that will be included in a more comprehensive infographic.

scatter-plot-17

Good luck, and if anyone has any improvements to the process, please post a comment.

Note: I’ve created a downloadable PDF of this tutorial that is available on Digital Splash Media.

One thought on “How to Make a Scatter Plot in Illustrator

  1. Thanks for the interesting post. Our workflow is to make a graphic in R, save as a PDF and then edit in illustrator. The PDFs that R produces are really clean so editing is easy. I tend to use ggplot2 in R.

Comments are closed.