-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add rename_size=TRUE to GeomSf, GeomCrossbar, GeomPointrange, and GeomSmooth #4884
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
Add rename_size=TRUE to GeomSf, GeomCrossbar, GeomPointrange, and GeomSmooth #4884
Conversation
Are you sure you should do |
In my understanding, when
That's my intention, but I'm not fully sure, so I'd welcome your comments :) library(ggplot2)
pt <- sf::st_point(c(2, 4))
ln <- sf::st_linestring(rbind(c(0, 1), c(5, 4)))
d <- sf::st_sf(id = 1:2, geometry = sf::st_sfc(pt, ln))
# current main branch
ggplot(d) +
geom_sf(size = 10) devtools::load_all("~/GitHub/ggplot2/")
#> ℹ Loading ggplot2
# this pull request
ggplot(d) +
geom_sf(size = 10) Created on 2022-06-20 by the reprex package (v2.0.1) |
You're right (I misunderstood exactly what all of what |
I see. There might be better word than "rename", but I have no idea atm |
Thanks - those were oversights on my part |
Thanks for confirming! I'm getting to feel we need a bit more consideration on |
For reference, while this pull request did make Lines 127 to 129 in e2d704e
Only these 3 Geoms are the cases. As I don't think we can fix this nicely and this is just a temporary workaround, I decided not to file an issue for this (but feel free to do it if necessary). library(ggplot2)
ns <- asNamespace("ggplot2")
geoms_names <- ls(ns, pattern = "Geom.*")
geoms <- lapply(geoms_names, \(x) get(x, ns))
idx <- vapply(geoms, \(x) {
all(c("linewidth", "size") %in% x$aesthetics())
}, logical(1L))
geoms_names[idx]
#> [1] "GeomBoxplot" "GeomPointrange" "GeomSf" Created on 2022-06-21 by the reprex package (v2.0.1) |
Fix #4883
Created on 2022-06-20 by the reprex package (v2.0.1)