Skip to content

Review messages of old coords and new guides #5707

Closed
@teunbrand

Description

@teunbrand

Prompted by #5684, we should probably emit more meaningful messages when position guides are specified in coord systems that do not support them.

coord_map() emits warning, but could do with a better message:

library(maps)
library(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: `guide_axis()` cannot be used for .
#> ℹ Use one of x, y, or r instead.

coord_polar() is silent

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  coord_polar() +
  guides(x = guide_axis(angle = 45))

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    messagesrequests for improvements to error, warning, or feedback messages

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions