Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scales-guides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ toy <- data.frame(
The scales toolbox in @sec-scale-position to @sec-scale-other provides extensive guidance for how to work with scales, focusing on solving common data visualisation problems.
The practical goals of the toolbox mean that topics are introduced when they are most relevant: for example, scale transformations are discussed in relation to continuous position scales (@sec-scale-transformation) because that is the most common situation in which you might want to transform a scale.
However, because ggplot2 aims to provide a grammar of graphics, there is nothing preventing you from transforming other kinds of scales (see @sec-scale-transformation-extras).
This chapter aims to illustrate these concepts: We'll discuss the theory underpinning scales and guides, and give examples showing how concepts that we've discussed specifically for position or colour scales also apply elsewhere.
This chapter aims to illustrate these concepts: we'll discuss the theory underpinning scales and guides, and give examples showing how concepts that we've discussed specifically for position or colour scales also apply elsewhere.

## Theory of scales and guides {#sec-scales-guides-theory}

Expand Down Expand Up @@ -148,7 +148,7 @@ You've probably already figured out the scheme, but to be concrete, it's made up

The naming structure is often helpful, but can sometimes be ambiguous.
For example, it is immediately clear that `scale_x_*()` functions apply to the x aesthetic, but it takes a little more thought to recognise that they also govern the behaviour of other aesthetics that describe a horizontal position (e.g., the `xmin`, `xmax`, and `xend` aesthetics).
Similarly, while the name `scale_colour_continuous()` clearly refers to the colour scale associated with a continuous variables, it is less obvious that `scale_colour_distiller()` is simply a different method for creating colour scales for continuous variables.
Similarly, while the name `scale_colour_continuous()` clearly refers to the colour scale associated with a continuous variable, it is less obvious that `scale_colour_distiller()` is simply a different method for creating colour scales for continuous variables.

### Fundamental scale types

Expand Down Expand Up @@ -280,7 +280,7 @@ New stuff: show examples where something other than the default guide is used...
## Scale transformation {#sec-scale-transformation-extras}

The most common use for scale transformations is to adjust a continuous position scale, as discussed in @sec-scale-transformation.
However, they can sometimes be helpful to when applied to other aesthetics.
However, they can sometimes be helpful when applied to other aesthetics.
Often this is purely a matter of visual emphasis.
An example of this for the Old Faithful density plot is shown below.
The linearly mapped scale on the left makes it easy to see the peaks of the distribution, whereas the transformed representation on the right makes it easier to see the regions of non-negligible density around those peaks: \index{Transformation!scales}
Expand Down Expand Up @@ -352,7 +352,7 @@ ggplot(df, aes(val)) + geom_bar() +
## Legend merging and splitting {#sec-legend-merge-split}

There is always a one-to-one correspondence between position scales and axes.
But the connection between non-position scales and legend is more complex: one legend may need to draw symbols from multiple layers ("merging"), or one aesthetic may need multiple legends ("splitting").
But the connection between non-position scales and legends is more complex: one legend may need to draw symbols from multiple layers ("merging"), or one aesthetic may need multiple legends ("splitting").

### Merging legends {#sec-sub-layers-legends}

Expand Down