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
7 changes: 3 additions & 4 deletions scales-position.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ status("polishing")

Position scales are used to control the locations of visual entities in a plot, and how those locations are mapped to data values.
Every plot has two position scales, corresponding to the x and y aesthetics.
In most cases this is clear in the plot specification, because the user explicitly specifies the variables mapped to x and y explicitly.
In most cases this is clear in the plot specification, because the user explicitly specifies the variables mapped to x and y.
However, this is not always the case.
Consider this plot specification:

Expand Down Expand Up @@ -45,7 +45,7 @@ The chapter is organised into four main sections:

The most common continuous position scales are the default `scale_x_continuous()` and `scale_y_continuous()` functions.
In the simplest case they map linearly from the data value to a location on the plot.
There are several other position scales for continuous variables---`scale_x_log10()`, `scale_x_reverse()`, etc---most of which are convenience functions used to provide easy access to common transformations, discussed in in @sec-scale-transformation.
There are several other position scales for continuous variables---`scale_x_log10()`, `scale_x_reverse()`, etc---most of which are convenience functions used to provide easy access to common transformations, discussed in @sec-scale-transformation.
\indexf{scale\_x\_continuous}

### Limits {#sec-position-continuous-limits}
Expand Down Expand Up @@ -735,8 +735,7 @@ ggplot(mpg, aes(x = drv, y = hwy)) + geom_boxplot(width = .4)

\index{Axis!labels} \index{Legend!keys}

The limits, breaks.
and labels for a discrete position scale can be set using the `limits`, `breaks`, and `labels` arguments.
The limits, breaks, and labels for a discrete position scale can be set using the `limits`, `breaks`, and `labels` arguments.
For the most part these behave identically to the corresponding arguments for numeric scales (@sec-numeric-position-scales), though there are some differences.
For example, the limits of a discrete scale are not defined in terms of endpoints, but instead correspond to the set of allowable values for that variable.
Accordingly, ggplot2 expects that the `limits` of a discrete scale should be a character vector that enumerates all possible values in the order they should appear:
Expand Down