Remove redundancy, closes #1316

This commit is contained in:
mine-cetinkaya-rundel 2023-03-02 00:52:42 -05:00
parent 84a70878a4
commit bd32ddcfbb
1 changed files with 1 additions and 3 deletions

View File

@ -94,7 +94,7 @@ When `class` is mapped to `shape`, we get two warnings:
Since ggplot2 will only use six shapes at a time, by default, additional groups will go unplotted when you use the shape aesthetic.
The second warning is related -- there are 62 SUVs in the dataset and they're not plotted.
Similarly, we can map `class` to `size` or `alpha` (transparency) aesthetics as well.
Similarly, we can map `class` to `size` or `alpha` aesthetics as well, which control the shape and the transparency of the points, respectively.
```{r}
#| layout-ncol: 2
@ -125,8 +125,6 @@ Both of these produce warnings as well:
Mapping a non-ordinal discrete (categorical) variable (`class`) to an ordered aesthetic (`size` or `alpha`) is generally not a good idea because it implies a ranking that does not in fact exist.
Similarly, we could have mapped `class` to the `alpha` aesthetic, which controls the transparency of the points, or to the `shape` aesthetic, which controls the shape of the points.
Once you map an aesthetic, ggplot2 takes care of the rest.
It selects a reasonable scale to use with the aesthetic, and it constructs a legend that explains the mapping between levels and values.
For x and y aesthetics, ggplot2 does not create a legend, but it creates an axis line with tick marks and a label.