diff --git a/communication.qmd b/communication.qmd index 2299d8f..ed02c80 100644 --- a/communication.qmd +++ b/communication.qmd @@ -243,13 +243,13 @@ To demonstrate using `annotate()`, let's create some text to add to our plot. The text is a bit long, so we'll use `stringr::str_wrap()` to automatically add line breaks to it given the number of characters you want per line: ```{r} -trend_text <- "Larger engine sizes tend to\nhave lower fuel economy." |> +trend_text <- "Larger engine sizes tend to have lower fuel economy." |> str_wrap(width = 30) trend_text ``` Then, we add two layers of annotation: one with a label geom and the other with a segment geom. -The `x` and `y` aesthetics in both define where the annotation should start, and the `xend` and `yend` aesthetics in the segment annotation define the starting location of the end location of the segment. +The `x` and `y` aesthetics in both define where the annotation should start, and the `xend` and `yend` aesthetics in the segment annotation define the end location of the segment. Note also that the segment is styled as an arrow. ```{r} @@ -468,10 +468,10 @@ base + theme(legend.position = "right") # the default base + theme(legend.position = "left") base + theme(legend.position = "top") + - guides(col = guide_legend(nrow = 3)) + guides(color = guide_legend(nrow = 3)) base + theme(legend.position = "bottom") + - guides(col = guide_legend(nrow = 3)) + guides(color = guide_legend(nrow = 3)) ``` If your plot is short and wide, place the legend at the legend at the top or bottom, and if it's tall and narrow, place the legend at the left or right.