-
Notifications
You must be signed in to change notification settings - Fork 2.1k
geom_sf()
: add support for scale_x_continuous(n.breaks = )
#4622
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
Comments
@clauswilke do you have a rough idea of why |
I'll take a look. |
Thanks... My guess is it comes down to |
I think it's these two lines: Lines 226 to 227 in f5e01ba
We're reading out the value of the Line 636 in f5e01ba
But I don't fully understand how the other coords use this code. I believe they call Lines 64 to 67 in f5e01ba
but my problem is that I see how coord_cartesian() does this but not how coord_polar() does this. Yet things seem to work for coord_polar() .
Maybe @paleolimbot can weigh in? |
I'm far removed from this to have a quick answer other than that I recall that the intention was to use the guide axis framework for the other Coord subclasses once the bugs had been ironed out for CoordCartesian. Perhaps this is a good time to do that for CoordSf? I'm nearly at a place where I could take that on but it will be a few weeks. |
But do I understand correctly that the guide axis framework is not needed to get the axis breaks right? So we could just fix the two lines in I would suspect that |
Yes, likely much easier! |
I think the concern with using |
Some additional limitations:
library(ggplot2)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot(nc) +
geom_sf() +
scale_x_continuous(breaks = NULL)
ggplot(nc) +
geom_sf() +
scale_x_continuous(breaks = scales::breaks_width(1))
#> Error in min(lon): invalid 'type' (closure) of argument Created on 2023-09-26 with reprex v2.0.2 |
Currently this argument does not have an effect when using
geom_sf()
.Created on 2021-09-18 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: