Skip to content

Commit

Permalink
style(sessions): 🎨 convert to markdown chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjohnst86 committed Jan 15, 2025
1 parent c8d250f commit 4012a5f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions sessions/visualization.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,24 @@ maintain a nice readable code and, two, there are some chunk options
that only work with one figure. However, it is possible to show multiple
graphs for instance side-by-side, as we will do later.

Now we can add a caption for the plot with the option`#| fig-cap`. Let's
add one as well as a figure label with `#| label` so we can reference it
in the text by using `@fig-LABEL`. Figure labels **must** always start
with `fig-`.
In the same code chunk, we can add a caption for the plot with the option`#|
fig-cap`. Let's add one as well as a figure label with `#| label` so we can
reference it in the text by using `@fig-LABEL`. Figure labels **must** always
start with `fig-`.

<!-- TODO: Confirm this looks fine in the generated text -->

```` {.markdown filename="docs/learning.qmd"}
```{{r}}
#| fig-cap: "Distribution of BMI."
#| label: fig-bmi-histo
ggplot(post_meal_data, aes(x = BMI)) +
geom_histogram()
```
````

```{r bmi-histogram}
#| echo: fenced
#| echo: false
#| fig-cap: "Distribution of BMI."
#| label: fig-bmi-histo
ggplot(post_meal_data, aes(x = BMI)) +
Expand Down

0 comments on commit 4012a5f

Please sign in to comment.