\setcounter{ExampleCounter}{1}
We'll look at three other graphical summaries of data:
\begin{enumerate}
\item Stem-and-leaf plots
\item Scatter plots
\item Time series plots
\end{enumerate}
\subsection{Stem-and-Leaf Plots}
\begin{itemize}
\item Somewhere between raw data and a frequency table
\item Still illustrates the grouping of data, but also shows all the data
\item Each data point gets split into a stem and a leaf; the leaf is the last significant digit
\end{itemize}

\begin{example}{Stem-and-Leaf Plot: Test Scores}
The test scores for a class look like the following.
\begin{center}
\begin{tabular}{c c c c c c c c c c c c}
81 & 86 & 78 & 80 & 81 & 82 & 92 & 90 & 79 & 83 & 84 & 95\\
84 & 79 & 80 & 83 & 79 & 87 & 84 & 80 & 85 & 88 & 80 & 78\\
\end{tabular}
\end{center}

The stems for these data points are the first digits, and the leaves are the second digits.
\begin{center}
\begin{tabular}{r | l }
Stems & Leaves\\
\hline
\\
7 & 8\ 8\ 9\ 9\ 9\\
8 & 0\ 0\ 0\ 0\ 1\ 1\ 2\ 3\ 3\ 4\ 4\ 4\ 5\ 6\ 7\ 8 \\
9 & 0\ 2\ 5\\
\end{tabular}
\end{center}
\end{example}
\vfill

\begin{example}{Stem-and-Leaf Plot: Distance to Supermarket}
The distances (in km) from a particular home to the closest supermarkets are shown below.
\begin{center}
\begin{tabular}{c c c c c c c}
1.1 & 1.5 & 2.3 & 2.5 & 2.7 & 3.2 & 3.3\\
3.3 & 3.5 & 3.8 & 4.0 & 4.2 & 4.5 & 4.5\\
4.7 & 4.8 & 5.5 & 5.6 & 6.5 & 6.7 & 12.3
\end{tabular}
\end{center}
\pagebreak

Construct a stem-and-leaf plot for this data, noting that the leaves are the digits to the right of the decimal.
\begin{center}
\begin{tabular}{r | l}
Stems & Leaves\\
\hline
\\
1 & 1\ 5 \\
2 & 3\ 5\ 7\\
3 & 2\ 3\ 3\ 5\ 8\\
4 & 0\ 2\ 5\ 5\ 7\ 8\\
5 & 5\ 6\\
6 & 5\ 7\\
7 & \\
8 & \\
9 & \\
10 & \\
11 & \\
12 & 3
\end{tabular}
\end{center}
\end{example}
\vfill

\subsection{Scatter Plots}
\begin{itemize}
\item Show the relationship between two quantitative variables
\item Typically used if we want to see whether there is a correlation between two quantities
\end{itemize}

\begin{example}{Scatter Plot: TV Price}
The following table shows, for a sample of Samsung LCD TVs, their size and their price.
\begin{center}
\begin{tabular}{c c | c c}
Size (in.) & Price (\$) & Size (in.) & Price (\$)\\
\hline
\\
43 & 500 & 60 & 1200\\
55 & 900 & 45 & 1600\\
51 & 900 & 19 & 200\\
32 & 400 & 55 & 2200\\
51 & 1200 & 60 & 1700\\
37 & 500 & 55 & 2000\\
60 & 2800 & 22 & 300\\
60 & 1100 & 40 & 600\\
46 & 1600 & 40 & 900
\end{tabular}
\end{center}

\paragraph{Note:} We could pick either variable to be $x$, but we typically let $x$ be the explanatory--or predictor--variable; in that example, it makes more sense to say that the size of a TV predicts its price than to say that the price of a TV predicts its size.

It turns out, though, that if we switch $x$ and $y$, nothing crucial really changes.

To construct a scatter plot, put the size along the $x$ axis, put price along the $y$ axis, and plot a point for each TV.
\pagebreak

\begin{center}
\begin{tikzpicture}
\begin{axis}[
    xmin=0, xmax=70,
    ymin=0, ymax=3000,
    axis lines=center,
    axis on top=false,
    domain=0:1,
    x=0.13cm,
    y=0.0013cm,
    xtick={5,10,...,70},
    xticklabels={5,10,...,70},
    ytick={0,500,...,3000},
    yticklabels={0,500,...,3000},
    axis lines=middle,
    axis line style={->},
    x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
    y label style={at={(axis description cs:-0.11,.5)},rotate=90,anchor=south},
    xlabel={Size (in.)},
    ylabel={Price (\$)},
    grid=major
    ]
	\addplot [blue,only marks,mark size=2] table {
	43 500
	55 900
	51 900
	32 400
	51 1200
	37 500
	60 2800
	60 1100
	46 1600
	60 1200
	45 1600
	19 200 
	55 2200
	60 1700
	55 2000
	22 300
	40 600
	40 900
	};
	%\addplot [blue, thick] table {
	
	%};
\end{axis}
\end{tikzpicture}
\end{center}
\end{example}
\vfill

\begin{example}{Scatter Plot: Home Prices}
The following table shows a sample of homes on the market, recording their size in square feet and their price in thousands of dollars (so for instance, the first home is selling for \$400,000).
\begin{center}
\begin{tabular}{c | c}
Size (sq. ft.) & Selling Price (\$1000s)\\
\hline
\\
2521 & 400\\
2555 & 426\\
2735 & 428\\
2846 & 435\\
3028 & 469\\
3049 & 475\\
3198 & 488\\
3198 & 455\\
\end{tabular}
\end{center}

Construct a scatter plot for this data.
\begin{center}
\begin{tikzpicture}
\begin{axis}[
    xmin=2450, xmax=3300,
    ymin=390, ymax=500,
    axis lines=center,
    axis on top=false,
    domain=0:1,
    x=0.01cm,
    y=0.038cm,
    xtick={2500,2550,...,3300},
    xticklabels={2500,,2600,,2700,,2800,,2900,,3000,,3100,,3200,,3300},
    ytick={390,400,...,500},
    yticklabels={390,400,...,500},
    axis lines=middle,
    axis line style={->},
    x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
    y label style={at={(axis description cs:-0.11,.5)},rotate=90,anchor=south},
    xlabel={Size (sq. ft.)},
    ylabel={Price (\$1000s)},
    grid=major
    ]
	\addplot [blue,only marks,mark size=2] table {
	2521 400
	2555 426
	2735 428
	2846 435
	3028 469
	3049 475
	3198 488
	3198 455
	};
	%\addplot [blue, thick] table {
	
	%};
\end{axis}
\end{tikzpicture}
\end{center}
\end{example}
\pagebreak

\subsection{Time Series Plots}
\begin{itemize}
\item Track changes over time (no kidding)
\item Start with a scatter plot where the $x$ axis represents time
\item Connect the points with a line
\end{itemize}

\begin{example}{Time Series: Disney Revenue}
The following table records the annual revenue for Disney from 1993 to 2012.
\begin{center}
\begin{tabular}{l c | l c}
Year & Revenue (billions of \$) & Year & Revenue (billions of \$)\\
\hline
& & & \\
1993 & 8.5 & 2003 & 27.1\\
1994 & 10.4 & 2004 & 30.8\\
1995 & 12.5 & 2005 & 31.9\\
1996 & 18.7 & 2006 & 33.7\\
1997 & 22.5 & 2007 & 35.5\\
1998 & 23.0 & 2008 & 37.8\\
1999 & 23.4 & 2009 & 36.1\\
2000 & 25.4 & 2010 & 38.1\\
2001 & 25.8 & 2011 & 40.9\\
2002 & 25.4 & 2012 & 42.3
\end{tabular}
\end{center}

The time series plot for this data looks like the following.
\begin{center}
\begin{tikzpicture}
\begin{axis}[
    xmin=1989, xmax=2015,
    ymin=0, ymax=45,
    axis lines=center,
    axis on top=false,
    domain=0:1,
    x=0.4cm,
    y=0.1cm,
    xtick={1990,1991,..., 2015},
    xticklabels={1990,,,,,1995,,,,,2000,,,,,2005,,,,,2010,,,,,2015},
    ytick={0,5,...,45},
    yticklabels={0,5,...,45},
    axis lines=middle,
    axis line style={->},
    x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
    y label style={at={(axis description cs:-0.11,.5)},rotate=90,anchor=south},
    xlabel={Year},
    ylabel={Revenue (billions of \$)},
    grid=major
    ]
	\addplot [blue,ultra thick] table {
	1993 8.5
	1994 10.4
	1995 12.5
	1996 18.7
	1997 22.5
	1998 23.0
	1999 23.4
	2000 25.4
	2001 25.8
	2002 25.4
	2003 27.1
	2004 30.8
	2005 31.9
	2006 33.7
	2007 35.5
	2008 37.8
	2009 36.1
	2010 38.1
	2011 40.9
	2012 42.3
	};
	%\addplot [blue, thick] table {
	
	%};
\end{axis}
\end{tikzpicture}
\end{center}
\end{example}
%\blankpage

%\begin{exercises}
%\textit{For problems 1--2, identify each of the given components of the study.}\\
%\ptwo{}
%\ptwo{}



%\end{exercises}
