How to make a graph in SPSS
In SPSS, choose Graphs > Chart Builder, pick a chart type, drag your variables onto the axes and click OK. The chart appears in the Viewer, where you can double-click it to edit it in the Chart Editor or export it as an image with File > Export.
Updated · 5 min read
Before you start: check your variable types
Chart Builder reads each variable's measurement level (nominal, ordinal or scale) and builds the chart around it. Most problems with a first SPSS chart start here. A numeric code for groups, such as 1 for treatment and 2 for control, has to be nominal or ordinal, or Chart Builder will not treat it as a category.
You can fix this in two places:
- For one chart: in Chart Builder, right-click the variable in the Variables list and choose a level. IBM describes this as a temporary change.
- For good: open Variable View in the Data Editor and set the Measure column. Categories should be nominal or ordinal. Measurements should be scale.
Make a graph with Chart Builder
The route is the same for every chart type:
- Choose Graphs > Chart Builder.
- Click the Gallery tab if it is not already showing, then pick a category in the Choose From list.
- Drag the picture of the chart you want onto the canvas, or double-click it.
- Drag variables from the Variables list into the axis drop zones. Every chart needs a variable on the x-axis.
- Click OK.
The chart appears in the Viewer. The preview on the canvas uses randomly generated data, so it only shows the rough shape. To change the statistic or the axis range before you click OK, use the Element Properties tab in the side bar.
IBM support articles for older releases also use a separate Graphs > Legacy Dialogs menu. This guide sticks to Chart Builder, which IBM's current help documents.
Which SPSS chart to pick
IBM's gallery covers bar, line, area, pie, scatter and dot, histogram, high-low, boxplot and dual y-axis charts. Pick from the question you are asking:
- Bar: compare a summary across groups, such as mean score by group.
- Line: show change over time or across any ordered sequence.
- Pie: show shares of one whole. In practice a pie reads well with a handful of slices; past that, a sorted bar chart is easier.
- Histogram: show the spread of one scale variable. It looks like a bar chart but answers a different question, as bar chart vs histogram explains.
- Scatter: show how two scale variables relate.
If you are still unsure, the chart picker walks through the choice.
Make a simple bar chart, step by step
Say you want mean test score by teaching group.
- In Variable View, check that the group variable is nominal and the score is scale.
- Choose Graphs > Chart Builder. Pick Bar in the Choose From list and drag the simple bar picture onto the canvas.
- Drag the group variable to the x-axis drop zone and the score to the y-axis drop zone. With a scale variable on the y-axis and a categorical one on the x-axis, IBM's Brief Guide gives Mean as the default statistic. Check it on the Element Properties tab.
- Click OK.
You get one bar per group. After the tidying steps below, it should read like this:
Group C's mean score is 9 points above Group A's
Mean test score by teaching group
Group C is the largest at 71, ahead of Group B (67). Group A is the smallest at 62.
Source: Sample data
| Teaching group | Mean score |
|---|---|
| Group A | 62 |
| Group B | 67 |
| Group C | 71 |
Make a line graph
Use the same route with a different picture. Open Chart Builder, pick Line in the Choose From list and drag the simple line picture onto the canvas. Put the time variable (year, month, survey wave) on the x-axis and the measure on the y-axis, then click OK.
A line joins points in order, so the x-axis needs a real order. If it holds unordered groups, such as regions or teams, use a bar chart instead.
Mean wellbeing score rose at every survey wave
Mean wellbeing score, 0 to 10
Mean wellbeing rose 19% from 5.80 to 6.90 between Wave 1 and Wave 4.
Source: Sample data
| Survey wave | Mean wellbeing |
|---|---|
| Wave 1 | 5.80 |
| Wave 2 | 6.10 |
| Wave 3 | 6.50 |
| Wave 4 | 6.90 |
Tidy the chart in the Chart Editor
The default chart has no title that says anything, labels taken straight from variable names and default colours. Fix that in the Chart Editor:
- Double-click the chart in the Viewer to open it in the Chart Editor.
- Double-click the element you want to change (a bar, an axis, a title) to open its Properties. You can also select it and choose Edit > Properties.
- Make the change and click Apply. The chart does not update until you do.
- Close the Chart Editor. IBM's help says your changes are saved when you close it.
IBM's help lists what you can change there: the size, font and colour of text; the fill colour of bars; line and marker styles; axis titles, ticks and tick labels; grid lines; number formats; the display order; and whether the legend shows. You can also add titles, footnotes, text boxes, annotations and data labels, and transpose the chart to turn columns into horizontal bars.
A few habits make the biggest difference:
- Start bars at zero. Readers judge bars by length, and Datawrapper calls truncated bar axes deceptive and misleading.
- Write a title that states the finding, such as "Group C scored highest", in place of the variable names.
- Hide the legend on a single-series chart and add data labels if exact values matter.
- Swap the default colours for a palette that works for colour-blind readers. See colour-blind-safe chart colours.
Export the graph as an image
- Make the Viewer the active window and choose File > Export.
- To export only the charts, set the document type to None (Graphics Only).
- Pick a format. IBM lists BMP, EPS, SVG, JPEG, PNG, TIF and PDF. EMF is also available on Windows.
- Click Change Options for format settings. For PNG, IBM lists image size as a percentage of the original chart, up to 200 percent, and colour depth. IBM's PNG page lists no resolution or DPI setting.
- Enter a file name and export. For charts, the name you enter works as a prefix.
For print, or anything that gets resized, SVG or EPS stays sharp at any size. For slides and documents, a PNG at 200 percent gives you more pixels than the default. If the chart is going into a report, exporting to Word (.docx) includes charts as high-resolution images.
A quicker route for bar, line and pie charts
If you only need a clean bar, line or pie chart of numbers you already have, Chartsmade can be quicker than an editing session. It does not open SPSS .sav files, so copy the summary table (the group means, say) out of the SPSS output first. Then paste it into the bar chart maker or the Chartsmade editor, pick a suggested chart and download a PNG (fixed sizes up to 1920×1080) or an SVG, with a transparent background if you want one. It is free to start, and free downloads carry a small "Made with Chartsmade" line.
Chartsmade has no histogram or scatter chart, so make those in SPSS.
Questions
- How do I create a simple line graph in SPSS?
- Choose Graphs > Chart Builder, pick Line in the Choose From list on the Gallery tab and drag the simple line picture onto the canvas. Drag your time variable to the x-axis drop zone and your measure to the y-axis, then click OK.
- Where is Chart Builder in SPSS?
- On the Graphs menu: choose Graphs > Chart Builder. Charts you create there appear in the Viewer.
- How do I save an SPSS graph as an image?
- In the Viewer, choose File > Export, set the document type to None (Graphics Only) and pick a format. IBM lists BMP, EPS, SVG, JPEG, PNG, TIF and PDF, plus EMF on Windows.
- Why does measurement level matter in Chart Builder?
- Chart Builder treats nominal, ordinal and scale variables differently, so a numeric code for groups that is set to scale will not behave as a category. Right-click the variable in Chart Builder to change its level for that chart, or change it permanently in Variable View.
- How do I change the colours or labels on an SPSS chart?
- Double-click the chart in the Viewer to open the Chart Editor, then double-click the bar, axis or text you want to change to open its Properties. Make the change and click Apply. Changes are saved when you close the Chart Editor.
Sources
- IBM SPSS Statistics 30, Building Charts (Chart Builder)
- IBM SPSS Statistics 30, Building a chart from the gallery
- IBM SPSS Statistics 30, Chart Builder layout and terms
- IBM SPSS Statistics 30, Variable types
- IBM SPSS Statistics 30, Chart types
- IBM SPSS Statistics 30, Chart Editor fundamentals
- IBM SPSS Statistics 30, Changing how a chart looks
- IBM SPSS Statistics 30, Adding and changing text in a chart
- IBM SPSS Statistics 30, Export output
- IBM SPSS Statistics 30, PNG export options
- IBM SPSS Statistics 30 Brief Guide (PDF)
- IBM Support, Properties dialog in chart editor not opening
- IBM Support, Pie chart of separate variables (Legacy Dialogs)
- Datawrapper Academy, Why our column and bar charts start at zero