Skip to content

Commit dce39a0

Browse files
committed
Coord doc tweaks
1 parent 6195204 commit dce39a0

13 files changed

+83
-78
lines changed

R/coord-cartesian-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Cartesian coordinates.
1+
#' Cartesian coordinates
22
#'
33
#' The Cartesian coordinate system is the most familiar, and common, type of
44
#' coordinate system. Setting limits on the coordinate system will zoom the

R/coord-fixed.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Cartesian coordinates with fixed relationship between x and y scales.
1+
#' Cartesian coordinates with fixed "aspect ratio"
22
#'
33
#' A fixed scale coordinate system forces a specified ratio between the
44
#' physical representation of data units on the axes. The ratio represents the

R/coord-flip.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#' Flipped cartesian coordinates.
1+
#' Cartesian coordinates with x and y flipped
22
#'
3-
#' Flipped cartesian coordinates so that horizontal becomes vertical, and
3+
#' Flip cartesian coordinates so that horizontal becomes vertical, and
44
#' vertical, horizontal. This is primarily useful for converting geoms and
55
#' statistics which display y conditional on x, to x conditional on y.
66
#'

R/coord-map.r

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
1-
#' Map projections.
1+
#' Map projections
22
#'
3-
#' The representation of a portion of the earth, which is approximately spherical,
4-
#' onto a flat 2D plane requires a projection. This is what
5-
#' \code{\link{coord_map}} does. These projections account for the fact that the
6-
#' actual length (in km) of one degree of longitude varies between the equator
7-
#' and the pole. Near the equator, the ratio between the lengths of one degree
8-
#' of latitude and one degree of longitude is approximately 1. Near the pole, it
9-
#' is tends towards infinity because the length of one degree of longitude tends
10-
#' towards 0. For regions that span only a few degrees and are not too close to
11-
#' the poles, setting the aspect ratio of the plot to the appropriate lat/lon
12-
#' ratio approximates the usual mercator projection. This is what
13-
#' \code{coord_quickmap} does. With \code{\link{coord_map}} all elements of the
14-
#' graphic have to be projected which is not the case here. So
15-
#' \code{\link{coord_quickmap}} has the advantage of being much faster, in
16-
#' particular for complex plots such as those using with
17-
#' \code{\link{geom_tile}}, at the expense of correctness in the projection.
18-
#' This coordinate system provides the full range of map projections available
19-
#' in the mapproj package.
3+
#' \code{coord_map} projects a portion of the earth, which is approximately
4+
#' spherical, onto a flat 2D plane using any projection defined by the
5+
#' \code{mapproj} package. Map projections do not, in general, preserve straight
6+
#' lines, so this requires considerable computation. \code{coord_quickmap} is a
7+
#' quick approximation that does preserve straight lines. It works best for
8+
#' smaller areas closer to the equator.
9+
#'
10+
#' In general, map projections must account for the fact that the actual length
11+
#' (in km) of one degree of longitude varies between the equator and the pole.
12+
#' Near the equator, the ratio between the lengths of one degree of latitude and
13+
#' one degree of longitude is approximately 1. Near the pole, it is tends
14+
#' towards infinity because the length of one degree of longitude tends towards
15+
#' 0. For regions that span only a few degrees and are not too close to the
16+
#' poles, setting the aspect ratio of the plot to the appropriate lat/lon ratio
17+
#' approximates the usual mercator projection. This is what
18+
#' \code{coord_quickmap} does, and is much faster (particularly for complex
19+
#' plots like \code{\link{geom_tile}}) at the expense of correctness.
2020
#'
21-
#' @export
2221
#' @param projection projection to use, see
2322
#' \code{\link[mapproj]{mapproject}} for list
24-
#' @param ... other arguments passed on to \code{\link[mapproj]{mapproject}}.
25-
#' Ignored if the \code{parameters} argument is present.
26-
#' @param parameters optional numeric vector of parameters for use
27-
#' with the projection argument. This argument is optional only in
28-
#' the sense that certain projections do not require additional
29-
#' parameters. Passed to \code{\link[mapproj]{mapproject}}.
23+
#' @param ...,parameters Other arguments passed on to
24+
#' \code{\link[mapproj]{mapproject}}. Use \code{...} for named parameters to
25+
#' the projection, and \code{parameters} for unnamed parameters.
26+
#' \code{...} is ignored if the \code{parameters} argument is present.
3027
#' @param orientation projection orientation, which defaults to
31-
#' \code{c(90, 0, mean(range(x)))}. This is not optimal for many
32-
#' projections, so you will have to supply your own. See
33-
#' \code{\link[mapproj]{mapproject}} for more information.
34-
#' @param xlim manually specific x limits (in degrees of longitude)
35-
#' @param ylim manually specific y limits (in degrees of latitude)
28+
#' \code{c(90, 0, mean(range(x)))}. This is not optimal for many
29+
#' projections, so you will have to supply your own. See
30+
#' \code{\link[mapproj]{mapproject}} for more information.
31+
#' @param xlim,ylim Manually specific x/y limits (in degrees of
32+
#' longitude/latitude)
3633
#' @export
3734
#' @examples
3835
#' if (require("maps")) {

R/coord-polar.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Polar coordinates.
1+
#' Polar coordinates
22
#'
33
#' The polar coordinate system is most commonly used for pie charts, which
44
#' are a stacked bar chart in polar coordinates.

R/coord-transform.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#' Transformed cartesian coordinate system.
1+
#' Transformed Cartesian coordinate system
22
#'
33
#' \code{coord_trans} is different to scale transformations in that it occurs after
44
#' statistical transformation and will affect the visual appearance of geoms - there is
55
#' no guarantee that straight lines will continue to be straight.
66
#'
7-
#' All current transformations only work with continuous values - see
8-
#' \code{\link[scales]{trans_new}} for list of transformations, and instructions on
9-
#' how to create your own.
7+
#' Transformations only work with continuous values: see
8+
#' \code{\link[scales]{trans_new}} for list of transformations, and instructions
9+
#' on how to create your own.
1010
#'
1111
#' @param x,y transformers for x and y axes
1212
#' @param xtrans,ytrans Deprecated; use \code{x} and \code{y} instead.

_pkgdown.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,19 @@ reference:
110110
- label_bquote
111111

112112
- title: Coordinate systems
113-
contents:
114-
- starts_with("coord_")
113+
desc:
114+
The coordinate system determines how the `x` and `y` aesthetics combine
115+
to position elements in the plot. The default coordinate system is
116+
Cartesian (`coord_cartesian()`), which can be tweaked with `coord_map()`,
117+
`coord_fixed()`, `coord_flip()`, and `coord_trans()`, or completely
118+
replaced with `coord_polar()`.
119+
contents:
120+
- coord_cartesian
121+
- coord_fixed
122+
- coord_flip
123+
- coord_map
124+
- coord_polar
125+
- coord_trans
115126

116127
- title: Themes
117128
contents:

man/coord_cartesian.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/coord_fixed.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/coord_flip.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)