You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*vertical lines* are used to denote quantities on the *horizontal axis*,
1055
1055
while *horizontal lines* are used to denote quantities on the *vertical axis*.
1056
1056
1057
-
```{r 03-data-morley-hist-2, warning=FALSE, message=FALSE,fig.cap = "Histogram of Michelson's speed of light data with vertical line indicating true speed of light."}
1057
+
```{r 03-data-morley-hist-2, warning=FALSE, fig.height = 3.5, fig.width = 4.5, fig.align = "center", message=FALSE,fig.cap = "Histogram of Michelson's speed of light data with vertical line indicating true speed of light."}
```{r 03-data-morley-hist-with-factor, warning=FALSE, message=FALSE, fig.cap = "Histogram of Michelson's speed of light data colored by experiment as factor."}
1110
+
```{r 03-data-morley-hist-with-factor, warning=FALSE, message=FALSE, fig.height = 3.5, fig.width = 5.5, fig.align = "center", fig.cap = "Histogram of Michelson's speed of light data colored by experiment as factor."}
1111
1111
morley_hist <- ggplot(morley, aes(x = Speed, fill = as_factor(Expt))) +
1112
1112
geom_histogram(alpha = 0.5, position = "identity") +
@@ -1146,7 +1146,7 @@ This function allows the column names to be correctly evaluated
1146
1146
in the context of the data frame.
1147
1147
\index{ggplot!facet\_grid}
1148
1148
1149
-
```{r 03-data-morley-hist-4, warning=FALSE, message=FALSE, fig.height = 7, fig.cap = "Histogram of Michelson's speed of light data split vertically by experiment."}
1149
+
```{r 03-data-morley-hist-4, warning=FALSE, message=FALSE, fig.height = 7, fig.align = "center", fig.cap = "Histogram of Michelson's speed of light data split vertically by experiment."}
1150
1150
morley_hist <- ggplot(morley, aes(x = Speed, fill = as_factor(Expt))) +
1151
1151
geom_histogram() +
1152
1152
facet_grid(rows = vars(Expt)) +
@@ -1171,7 +1171,7 @@ of just how accurate all the experiments were overall. For example, how accurate
1171
1171
To answer this question, we'll use the `mutate` function to transform our data into a relative measure of accuracy rather than absolute measurements:
1172
1172
\index{ggplot!labs}\index{ggplot!theme}
1173
1173
1174
-
```{r 03-data-morley-hist-5, warning=FALSE, message=FALSE, fig.height = 7, fig.cap = "Histogram of relative accuracy split vertically by experiment with clearer axes and labels."}
1174
+
```{r 03-data-morley-hist-5, warning=FALSE, message=FALSE, fig.height = 7, fig.align = "center", fig.cap = "Histogram of relative accuracy split vertically by experiment with clearer axes and labels."}
1175
1175
morley_rel <- mutate(morley,
1176
1176
relative_accuracy = 100 *
1177
1177
((299000 + Speed) - 299792.458) / (299792.458))
@@ -1227,7 +1227,7 @@ In this case, we can see that both the default number of bins
1227
1227
and the binwidth of 0.01 are effective for helping answer our question.
1228
1228
On the other hand, the bin widths of 0.001 and 0.1 are too small and too big, respectively.
1229
1229
1230
-
```{r 03-data-morley-hist-binwidth, echo = FALSE, warning = FALSE, message = FALSE, fig.height = 10, fig.cap = "Effect of varying bin width on histograms."}
1230
+
```{r 03-data-morley-hist-binwidth, echo = FALSE, warning = FALSE, message = FALSE, fig.height = 10, fig.align = "center", fig.cap = "Effect of varying bin width on histograms."}
1231
1231
morley_hist_default <- ggplot(morley_rel,
1232
1232
aes(x = relative_accuracy,
1233
1233
fill = as_factor(Expt))) +
@@ -1294,7 +1294,7 @@ For example, if we wanted to add a title to the last plot we created (`morley_hi
1294
1294
we can use the `+` operator to add a title layer with the `ggtitle` function.
1295
1295
The result is shown in Figure \@ref(fig:03-data-morley-hist-addlayer).
1296
1296
1297
-
```{r 03-data-morley-hist-addlayer, warning = FALSE, message = FALSE, fig.height = 7, fig.cap = "Histogram of relative accuracy split vertically by experiment with a descriptive title highlighting the take home message of the visualization."}
1297
+
```{r 03-data-morley-hist-addlayer, warning = FALSE, message = FALSE, fig.height = 7, fig.align = "center", fig.cap = "Histogram of relative accuracy split vertically by experiment with a descriptive title highlighting the take home message of the visualization."}
1298
1298
morley_hist_title <- morley_hist +
1299
1299
ggtitle("Speed of light experiments \n were accurate to about 0.05%")
1300
1300
@@ -1428,7 +1428,7 @@ scatter plot of
1428
1428
the [Old Faithful data set](https://www.stat.cmu.edu/~larry/all-of-statistics/=data/faithful.dat)[@faithfuldata],
1429
1429
shown in Figure \@ref(fig:03-plot-line).
1430
1430
1431
-
```{r 03-plot-line, collapse=TRUE, warning=FALSE, message=FALSE, fig.width = 4.5, fig.height = 3.75, fig.cap = "Scatter plot of waiting time and eruption time."}
1431
+
```{r 03-plot-line, collapse=TRUE, warning=FALSE, message=FALSE, fig.width = 3.75, fig.height = 3.5, fig.cap = "Scatter plot of waiting time and eruption time."}
0 commit comments