Skip to main content
Statistics LibreTexts

5: Drawing Graphs

  • Page ID
    29459
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Above all else show the data.

    –Edward Tufte86

    Visualizing data is one of the most important tasks facing the data analyst. It’s important for two distinct but closely related reasons. Firstly, there’s the matter of drawing “presentation graphics”: displaying your data in a clean, visually appealing fashion makes it easier for your reader to understand what you’re trying to tell them. Equally important, perhaps even more important, is the fact that drawing graphs helps you understand the data. To that end, it’s important to draw “exploratory graphics” that help you learn about the data as you go about analyzing it. These points might seem pretty obvious, but I cannot count the number of times I’ve seen people forget them.

    snowmap1-1.png
    Figure 6.1: A stylized redrawing of John Snow’s original cholera map. Each small dot represents the location of a cholera case, and each large circle shows the location of a well. As the plot makes clear, the cholera outbreak is centered very closely on the Broad St pump. This image uses the data from the HistData package @[Friendly2011], and was drawn using minor alterations to the commands provided in the help files. Note that Snow’s original hand-drawn map used different symbols and labels, but you get the idea.

    To give a sense of the importance of this chapter, I want to start with a classic illustration of just how powerful a good graph can be. To that end, Figure 6.1 shows a redrawing of one of the most famous data visualizations of all time: John Snow’s 1854 map of cholera deaths. The map is elegant in its simplicity. In the background, we have a street map, which helps orient the viewer. Over the top, we see a large number of small dots, each one representing the location of a cholera case. The larger symbols show the location of water pumps, labeled by name. Even the most casual inspection of the graph makes it very clear that the source of the outbreak is almost certainly the Broad Street pump. Upon viewing this graph, Dr. Snow arranged to have the handle removed from the pump, ending the outbreak that had killed over 500 people. Such is the power of a good data visualization.

    The goals in this chapter are twofold: firstly, to discuss several fairly standard graphs that we use a lot when analyzing and presenting data, and secondly, to show you how to create these graphs in SPSS. The graphs themselves tend to be pretty straightforward, so in that respect, this chapter is pretty simple. Where people usually struggle is learning how to produce graphs and especially learning how to produce good graphs.87 Fortunately, learning how to draw graphs in SPSS is reasonably simple, as long as you’re not too picky about what your graph looks like. What I mean when I say this is that SPSS has a lot of very good graphing functions, and most of the time you can produce a clean, high-quality graphic without having to learn very much about the low-level details of how SPSS handles graphics. Unfortunately, on those occasions when you do want to do something non-standard, or if you need to make highly specific changes to the figure, you actually do need to learn a fair bit about these details; and those details are both complicated and boring. With that in mind, the structure of this chapter is as follows: I’ll start out by giving you a very quick overview of how graphics work in SPSS. I’ll then discuss several different kinds of graphs and how to draw them, as well as showing the basics of how to customize these plots.


    This page titled 5: Drawing Graphs is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Danielle Navarro.