Skip to content

Use linewidth more #4959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions R/annotation-map.r
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ NULL
#' # use with coord_sf() for appropriate projection
#' p +
#' coord_sf(
#' crs = st_crs(3347),
#' default_crs = st_crs(4326), # data is provided as long-lat
#' crs = sf::st_crs(3347),
#' default_crs = sf::st_crs(4326), # data is provided as long-lat
#' xlim = c(-84, -76),
#' ylim = c(34, 37.2)
#' )
Expand All @@ -52,9 +52,9 @@ NULL
#' p +
#' geom_sf(
#' data = nc, inherit.aes = FALSE,
#' fill = NA, color = "black", size = 0.1
#' fill = NA, color = "black", linewidth = 0.1
#' ) +
#' coord_sf(crs = st_crs(3347), default_crs = st_crs(4326))
#' coord_sf(crs = sf::st_crs(3347), default_crs = sf::st_crs(4326))
#' }}}
annotation_map <- function(map, ...) {
# Get map input into correct form
Expand Down Expand Up @@ -99,7 +99,7 @@ GeomAnnotationMap <- ggproto("GeomAnnotationMap", GeomMap,
id = grob_id,
gp = gpar(
col = data$colour, fill = alpha(data$fill, data$alpha),
lwd = data$size * .pt)
lwd = data$linewidth * .pt)
)
},

Expand Down
2 changes: 1 addition & 1 deletion R/annotation.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' p + annotate("segment", x = 2.5, xend = 4, y = 15, yend = 25,
#' colour = "blue")
#' p + annotate("pointrange", x = 3.5, y = 20, ymin = 12, ymax = 28,
#' colour = "red", size = 1.5)
#' colour = "red", size = 2.5, linewidth = 1.5)
#'
#' p + annotate("text", x = 2:3, y = 20:21, label = c("my label", "label 2"))
#'
Expand Down
6 changes: 3 additions & 3 deletions R/fortify-lm.r
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
#'
#' plot(mod, which = 5)
#' ggplot(mod, aes(.hat, .stdresid)) +
#' geom_vline(size = 2, colour = "white", xintercept = 0) +
#' geom_hline(size = 2, colour = "white", yintercept = 0) +
#' geom_vline(linewidth = 2, colour = "white", xintercept = 0) +
#' geom_hline(linewidth = 2, colour = "white", yintercept = 0) +
#' geom_point() + geom_smooth(se = FALSE)
#'
#' ggplot(mod, aes(.hat, .stdresid)) +
#' geom_point(aes(size = .cooksd)) +
#' geom_smooth(se = FALSE, size = 0.5)
#' geom_smooth(se = FALSE, linewidth = 0.5)
#'
#' plot(mod, which = 6)
#' ggplot(mod, aes(.hat, .cooksd)) +
Expand Down
2 changes: 1 addition & 1 deletion R/geom-density2d.r
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#'
#' # contour bands and contour lines
#' m + geom_density_2d_filled(alpha = 0.5) +
#' geom_density_2d(size = 0.25, colour = "black")
#' geom_density_2d(linewidth = 0.25, colour = "black")
#'
#' set.seed(4393)
#' dsmall <- diamonds[sample(nrow(diamonds), 1000), ]
Expand Down
2 changes: 1 addition & 1 deletion R/geom-linerange.r
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @eval rd_orientation()
#'
#' @eval rd_aesthetics("geom", "linerange")
#' @eval rd_aesthetics("geom", "linerange", "Note that `geom_pointrange()` also understands `size` for the size of the points.")
#' @param fatten A multiplicative factor used to increase the size of the
#' middle bar in `geom_crossbar()` and the middle point in
#' `geom_pointrange()`.
Expand Down
6 changes: 3 additions & 3 deletions R/geom-path.r
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
#' # Control line join parameters
#' df <- data.frame(x = 1:3, y = c(4, 1, 9))
#' base <- ggplot(df, aes(x, y))
#' base + geom_path(size = 10)
#' base + geom_path(size = 10, lineend = "round")
#' base + geom_path(size = 10, linejoin = "mitre", lineend = "butt")
#' base + geom_path(linewidth = 10)
#' base + geom_path(linewidth = 10, lineend = "round")
#' base + geom_path(linewidth = 10, linejoin = "mitre", lineend = "butt")
#'
#' # You can use NAs to break the line.
#' df <- data.frame(x = 1:5, y = c(1, 2, NA, 4, 5))
Expand Down
2 changes: 1 addition & 1 deletion R/geom-polygon.r
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#' y = cumsum(runif(50,max = 0.1))
#' )
#'
#' p + geom_line(data = stream, colour = "grey30", size = 5)
#' p + geom_line(data = stream, colour = "grey30", linewidth = 5)
#'
#' # And if the positions are in longitude and latitude, you can use
#' # coord_map to produce different map projections.
Expand Down
2 changes: 1 addition & 1 deletion R/geom-quantile.r
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' m + geom_quantile(method = "rqss", lambda = 0.1)
#'
#' # Set aesthetics to fixed value
#' m + geom_quantile(colour = "red", size = 2, alpha = 0.5)
#' m + geom_quantile(colour = "red", linewidth = 2, alpha = 0.5)
geom_quantile <- function(mapping = NULL, data = NULL,
stat = "quantile", position = "identity",
...,
Expand Down
2 changes: 1 addition & 1 deletion R/geom-segment.r
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#' with(counts, plot(x, Freq, type = "h", lwd = 10))
#'
#' ggplot(counts, aes(x, Freq)) +
#' geom_segment(aes(xend = x, yend = 0), size = 10, lineend = "butt")
#' geom_segment(aes(xend = x, yend = 0), linewidth = 10, lineend = "butt")
geom_segment <- function(mapping = NULL, data = NULL,
stat = "identity", position = "identity",
...,
Expand Down
2 changes: 1 addition & 1 deletion R/scale-linetype.r
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' )
#' )
#' ggplot(df_lines) +
#' geom_hline(aes(linetype = linetype, yintercept = 0), size = 2) +
#' geom_hline(aes(linetype = linetype, yintercept = 0), linewidth = 2) +
#' scale_linetype_identity() +
#' facet_grid(linetype ~ .) +
#' theme_void(20)
Expand Down
4 changes: 2 additions & 2 deletions R/stat-summary.r
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
#' @export
#' @examples
#' d <- ggplot(mtcars, aes(cyl, mpg)) + geom_point()
#' d + stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 2)
#' d + stat_summary(fun.data = "mean_cl_boot", colour = "red", linewidth = 2, size = 3)
#'
#' # Orientation follows the discrete axis
#' ggplot(mtcars, aes(mpg, factor(cyl))) +
#' geom_point() +
#' stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 2)
#' stat_summary(fun.data = "mean_cl_boot", colour = "red", linewidth = 2, size = 3)
#'
#' # You can supply individual functions to summarise the value at
#' # each x:
Expand Down
2 changes: 1 addition & 1 deletion man/annotate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/annotation_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/fortify.lm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geom_density_2d.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/geom_linerange.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/geom_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geom_polygon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geom_quantile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geom_segment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/scale_linetype.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/stat_summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.