Skip to content
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

Better warnings for old coords and new guides #5708

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5707.

Briefly, both coord_map() and coord_polar() now throw a warning that they cannot render the relevant guides.

Reprex:

library(maps)
devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

nz <- map_data("nz")
ggplot(nz, aes(x = long, y = lat, group = group)) +
  geom_polygon(fill = "white", colour = "black") +
  coord_map() +
  guides(x = guide_axis(angle = 45))
#> Warning: `coord_map()` cannot render guide for the aesthetic: x.

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  coord_polar() +
  guides(y = guide_axis(angle = 45), r = guide_axis())
#> Warning: `coord_polar()` cannot render guides for the aesthetics: y and r.

Created on 2024-02-23 with reprex v2.1.0

@teunbrand teunbrand requested a review from thomasp85 March 4, 2024 09:56
@thomasp85 thomasp85 added this to the ggplot2 3.5.1 milestone Mar 18, 2024
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit a0205df into tidyverse:main Mar 18, 2024
12 checks passed
@teunbrand teunbrand deleted the coord_guide_interaction branch March 18, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review messages of old coords and new guides
2 participants