Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 39 ยท Charts and Output

Chart Builder in SPSS: Bar, Histogram, Boxplot, Scatter

Build charts in SPSS with the Chart Builder: choose the right chart for each variable type, drag variables onto the canvas, edit in the Chart Editor and paste GGRAPH syntax.

A chart shows you what a table of numbers hides: outliers, skew, clusters, curves. In SPSS, almost every chart can be made through Graphs > Chart Builder, a drag-and-drop canvas. This lesson explains how to choose a chart, how to build it, and how to polish it for a report.

Choose the chart by the variables

What you want to show Variables Chart
Counts or percentages of categories One categorical Bar chart (or pie for very few parts)
Distribution of a scale variable One scale Histogram
Spread, median and outliers One scale, optionally by group Boxplot
Means by group Scale by categorical Bar of means with error bars
Relationship of two scale variables Two scale Scatterplot
Change over time Scale by time Line chart
Categories of one variable split by another Two categorical Clustered or stacked bar

Honest charts start axes at zero for bars, label axes with units and avoid 3-D effects.

flowchart LR
    V["Pick variables"] --> T["Choose chart type in the Gallery"]
    T --> D["Drag variables to the canvas"]
    D --> P["Element Properties: statistic, bins, error bars"]
    P --> O["OK: chart appears in the Output Viewer"]
    O --> E["Double-click to open the Chart Editor"]

The Chart Builder workflow from variables to a polished chart.

Using the Chart Builder

  1. Open Graphs > Chart Builder. A warning asks you to make sure measurement levels are right (Scale, Ordinal, Nominal); this decides which variables are offered where, so fix Variable View first if needed. Click OK.
  2. The Gallery tab lists chart families (Bar, Line, Area, Pie/Polar, Scatter/Dot, Histogram, High-Low, Boxplot, Dual Axes). Click a family and drag a thumbnail onto the canvas.
  3. Drag variables from the left list onto the axis drop zones (X-Axis, Y-Axis) and to Cluster on X or Set color for grouping.
  4. Open the Element Properties panel (button on the right). For a bar chart choose the statistic (Value, Count, Mean, Median, Percentage), tick Display error bars (95% confidence interval, standard error or standard deviation) and press Apply.
  5. The Chart Appearance and Titles/Footnotes tabs set titles, templates and sizes.
  6. Click OK; the chart lands in the Output Viewer.

Two worked examples

A bar chart of group means with error bars. Gallery > Bar > Simple Bar; drag method to the X-axis, score to the Y-axis (it shows the mean by default); in Element Properties tick Display error bars, choose Confidence intervals 95%. Error bars that barely overlap or do not overlap hint at a difference, which a test such as one-way ANOVA then examines.

A histogram. Gallery > Histogram > Simple Histogram; drag score to the X-axis, tick Display normal curve in Element Properties. Use the shape (skew, two humps) to decide between parametric and non-parametric tests.

Pasting the syntax

The Paste button writes a GGRAPH command containing a block of Graphics Production Language (GPL). It is long, but you only edit variable names. A much shorter, older command still works for simple charts:

Text
GRAPH /BAR(SIMPLE)=MEAN(score) BY method
  /TITLE='Mean score by teaching method'.

GRAPH /HISTOGRAM(NORMAL)=score.

EXAMINE VARIABLES=score BY method
  /PLOT=BOXPLOT /STATISTICS=NONE /NOTOTAL.

The legacy menu route is Graphs > Legacy Dialogs (Bar, Line, Histogram, Scatter/Dot, Boxplot). Many analysts still prefer it for quick charts, and the Explore dialog draws boxplots with case numbers beside outliers.

Python Stand-in: a text histogram and boxplot numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A boxplot draws the box from Q1 to Q3, the line at the median, whiskers to the furthest points within 1.5 IQR of the box, a circle for each case beyond that (outlier) and a star for cases beyond 3 IQR.

Editing in the Chart Editor

Double-click any chart in the Output Viewer. In the Chart Editor you can:

  • change colours, fills, patterns and fonts (select an element, then Properties);
  • edit axis ranges, labels, number formats and tick marks;
  • add a reference line, a fit line (Elements > Fit Line at Total) or data labels;
  • flip axes, swap series order and apply a saved chart template (File > Save Chart Template).

A good habit is to save a template with your preferred fonts and colours and apply it to every chart for a consistent report.

Exporting a chart

Right-click the chart in the Output Viewer and choose Copy (then paste into Word) or Export to PNG, JPEG, EMF or TIFF. Use a high resolution for print. Export of whole documents is covered in working with pivot tables and exports.

Common mistakes

  • Wrong measurement level, so the Chart Builder offers the wrong chart options.
  • Truncated bar-chart axes that exaggerate small differences.
  • Too many colours or pie slices.
  • Showing bars of means without any indication of spread.
  • Charting without checking the Output Viewer's Log for dropped cases.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which chart shows the distribution of one scale variable?

    A histogram bins the values and counts them, showing shape, skew and gaps.
  2. 2. How do you add error bars to a bar of means in the Chart Builder?

    Element Properties holds the statistic and the error bar options (CI, SE or SD).
  3. 3. What does a circle beyond the whisker in an SPSS boxplot mean?

    Circles are outliers (1.5-3 IQR); stars mark extreme values beyond 3 IQR.
  4. 4. Where do you fine-tune colours and axes of a finished chart?

    Double-clicking a chart in the Output Viewer opens the Chart Editor.

Summary

  • Choose the chart from the variable types; Graphs > Chart Builder is the main route and Legacy Dialogs the quick one.
  • Drag variables to the canvas, set the statistic and error bars in Element Properties.
  • Boxplots and histograms reveal outliers and skew before you test.
  • Polish in the Chart Editor, save a template, export as an image.

Next: Working with Pivot Tables and Exporting Output