
i
i
“K23166” — 2015/1/28 — 9:35 — page 128 — #154
i
i
i
i
i
i
128 CHAPTER 8. A GRAPHICAL COMPENDIUM
Note: To create a figure with a single y axis value, it is straightforward to repeatedly call
points() or other functions to add elements.
In the second example, two functions addsecondy() and plottwoy() are defined to add
points on a new scale and an appropriate axis on the right. This involves rescaling and
labeling the second axis (side=4) with 6 tick marks, as well as rescaling the y2 variable.
8.3.3 Scatterplot with binning
When there are many observations, scatterplots can become difficult to read because many
plot symbols will obscure one another. One solution ...