Skip to content

Commit de4c225

Browse files
Use linewidth more (#4959)
1 parent 8bc749f commit de4c225

22 files changed

+40
-38
lines changed

R/annotation-map.r

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ NULL
4141
#' # use with coord_sf() for appropriate projection
4242
#' p +
4343
#' coord_sf(
44-
#' crs = st_crs(3347),
45-
#' default_crs = st_crs(4326), # data is provided as long-lat
44+
#' crs = sf::st_crs(3347),
45+
#' default_crs = sf::st_crs(4326), # data is provided as long-lat
4646
#' xlim = c(-84, -76),
4747
#' ylim = c(34, 37.2)
4848
#' )
@@ -52,9 +52,9 @@ NULL
5252
#' p +
5353
#' geom_sf(
5454
#' data = nc, inherit.aes = FALSE,
55-
#' fill = NA, color = "black", size = 0.1
55+
#' fill = NA, color = "black", linewidth = 0.1
5656
#' ) +
57-
#' coord_sf(crs = st_crs(3347), default_crs = st_crs(4326))
57+
#' coord_sf(crs = sf::st_crs(3347), default_crs = sf::st_crs(4326))
5858
#' }}}
5959
annotation_map <- function(map, ...) {
6060
# Get map input into correct form
@@ -99,7 +99,7 @@ GeomAnnotationMap <- ggproto("GeomAnnotationMap", GeomMap,
9999
id = grob_id,
100100
gp = gpar(
101101
col = data$colour, fill = alpha(data$fill, data$alpha),
102-
lwd = data$size * .pt)
102+
lwd = data$linewidth * .pt)
103103
)
104104
},
105105

R/annotation.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#' p + annotate("segment", x = 2.5, xend = 4, y = 15, yend = 25,
3131
#' colour = "blue")
3232
#' p + annotate("pointrange", x = 3.5, y = 20, ymin = 12, ymax = 28,
33-
#' colour = "red", size = 1.5)
33+
#' colour = "red", size = 2.5, linewidth = 1.5)
3434
#'
3535
#' p + annotate("text", x = 2:3, y = 20:21, label = c("my label", "label 2"))
3636
#'

R/fortify-lm.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@
5555
#'
5656
#' plot(mod, which = 5)
5757
#' ggplot(mod, aes(.hat, .stdresid)) +
58-
#' geom_vline(size = 2, colour = "white", xintercept = 0) +
59-
#' geom_hline(size = 2, colour = "white", yintercept = 0) +
58+
#' geom_vline(linewidth = 2, colour = "white", xintercept = 0) +
59+
#' geom_hline(linewidth = 2, colour = "white", yintercept = 0) +
6060
#' geom_point() + geom_smooth(se = FALSE)
6161
#'
6262
#' ggplot(mod, aes(.hat, .stdresid)) +
6363
#' geom_point(aes(size = .cooksd)) +
64-
#' geom_smooth(se = FALSE, size = 0.5)
64+
#' geom_smooth(se = FALSE, linewidth = 0.5)
6565
#'
6666
#' plot(mod, which = 6)
6767
#' ggplot(mod, aes(.hat, .cooksd)) +

R/geom-density2d.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#'
3636
#' # contour bands and contour lines
3737
#' m + geom_density_2d_filled(alpha = 0.5) +
38-
#' geom_density_2d(size = 0.25, colour = "black")
38+
#' geom_density_2d(linewidth = 0.25, colour = "black")
3939
#'
4040
#' set.seed(4393)
4141
#' dsmall <- diamonds[sample(nrow(diamonds), 1000), ]

R/geom-linerange.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#'
66
#' @eval rd_orientation()
77
#'
8-
#' @eval rd_aesthetics("geom", "linerange")
8+
#' @eval rd_aesthetics("geom", "linerange", "Note that `geom_pointrange()` also understands `size` for the size of the points.")
99
#' @param fatten A multiplicative factor used to increase the size of the
1010
#' middle bar in `geom_crossbar()` and the middle point in
1111
#' `geom_pointrange()`.

R/geom-path.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
#' # Control line join parameters
6868
#' df <- data.frame(x = 1:3, y = c(4, 1, 9))
6969
#' base <- ggplot(df, aes(x, y))
70-
#' base + geom_path(size = 10)
71-
#' base + geom_path(size = 10, lineend = "round")
72-
#' base + geom_path(size = 10, linejoin = "mitre", lineend = "butt")
70+
#' base + geom_path(linewidth = 10)
71+
#' base + geom_path(linewidth = 10, lineend = "round")
72+
#' base + geom_path(linewidth = 10, linejoin = "mitre", lineend = "butt")
7373
#'
7474
#' # You can use NAs to break the line.
7575
#' df <- data.frame(x = 1:5, y = c(1, 2, NA, 4, 5))

R/geom-polygon.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#' y = cumsum(runif(50,max = 0.1))
5757
#' )
5858
#'
59-
#' p + geom_line(data = stream, colour = "grey30", size = 5)
59+
#' p + geom_line(data = stream, colour = "grey30", linewidth = 5)
6060
#'
6161
#' # And if the positions are in longitude and latitude, you can use
6262
#' # coord_map to produce different map projections.

R/geom-quantile.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' m + geom_quantile(method = "rqss", lambda = 0.1)
2929
#'
3030
#' # Set aesthetics to fixed value
31-
#' m + geom_quantile(colour = "red", size = 2, alpha = 0.5)
31+
#' m + geom_quantile(colour = "red", linewidth = 2, alpha = 0.5)
3232
geom_quantile <- function(mapping = NULL, data = NULL,
3333
stat = "quantile", position = "identity",
3434
...,

R/geom-segment.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#' with(counts, plot(x, Freq, type = "h", lwd = 10))
6868
#'
6969
#' ggplot(counts, aes(x, Freq)) +
70-
#' geom_segment(aes(xend = x, yend = 0), size = 10, lineend = "butt")
70+
#' geom_segment(aes(xend = x, yend = 0), linewidth = 10, lineend = "butt")
7171
geom_segment <- function(mapping = NULL, data = NULL,
7272
stat = "identity", position = "identity",
7373
...,

R/scale-linetype.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#' )
2626
#' )
2727
#' ggplot(df_lines) +
28-
#' geom_hline(aes(linetype = linetype, yintercept = 0), size = 2) +
28+
#' geom_hline(aes(linetype = linetype, yintercept = 0), linewidth = 2) +
2929
#' scale_linetype_identity() +
3030
#' facet_grid(linetype ~ .) +
3131
#' theme_void(20)

0 commit comments

Comments
 (0)