Skip to content

Commit 9c4c7cf

Browse files
sync viz with python book; remove old style syntax fig
1 parent f587a05 commit 9c4c7cf

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

img/viz/ggplot_function_scatter.jpeg

-242 KB
Binary file not shown.

source/viz.Rmd

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -282,33 +282,14 @@ There are a few basic aspects of a plot that we need to specify:
282282
- To create a geometric object, we use a `geom_*` function (see the [ggplot reference](https://ggplot2.tidyverse.org/reference/) for a list of geometric objects).
283283
- Here, we use the `geom_point` function to visualize our data as a scatter plot.
284284

285-
Figure \@ref(fig:03-ggplot-function-scatter)
286-
shows how each of these aspects map to code
287-
for creating a basic scatter plot of the `co2_df` data.
288-
Note that we could pass many other possible arguments to the aesthetic mapping
289-
and geometric object to change how the plot looks. For the purposes of quickly
290-
testing things out to see what they look like, though, we can just start with the
291-
default settings.
292-
\index{ggplot!aes}
293-
\index{ggplot!geom\_point}
294-
295-
(ref:03-ggplot-function-scatter) Creating a scatter plot with the `ggplot` function.
296-
297-
```{r 03-ggplot-function-scatter, echo = FALSE, fig.align = "center", fig.cap = "(ref:03-ggplot-function-scatter)", message = FALSE, out.width = "100%"}
298-
image_read("img/viz/ggplot_function_scatter.jpeg") |>
299-
image_crop("1625x1900")
300-
```
301-
302-
\newpage
303-
304285
```{r 03-data-co2-scatter, warning=FALSE, message=FALSE, fig.height = 3.1, fig.width = 4.5, fig.align = "center", fig.cap = "Scatter plot of atmospheric concentration of CO$_{2}$ over time."}
305286
co2_scatter <- ggplot(co2_df, aes(x = date_measured, y = ppm)) +
306287
geom_point()
307288
308289
co2_scatter
309290
```
310291

311-
Certainly, the visualization in Figure \@ref(fig:03-data-co2-scatter)
292+
The visualization in Figure \@ref(fig:03-data-co2-scatter)
312293
shows a clear upward trend
313294
in the atmospheric concentration of CO$_{\text{2}}$ over time.
314295
This plot answers the first part of our question in the affirmative,

0 commit comments

Comments
 (0)