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

geom_raster() fallback for non-Cartesian coords #5627

Merged
merged 5 commits into from
May 20, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5503.

Briefly, geom_raster() now falls back to drawing as geom_rect() when coordinates are non-linear.
A small outline in the same colour as the fill aesthetic is added to prevent anti-aliasing.

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

ggplot(faithfuld, aes(eruptions, waiting, fill = density)) +
  geom_raster() +
  coord_polar()
#> `geom_raster()` only works with `coord_cartesian()`.
#> ℹ Falling back to drawing as `geom_rect()`.

Created on 2024-01-04 with reprex v2.0.2

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 1654df1 into tidyverse:main May 20, 2024
11 checks passed
@teunbrand teunbrand deleted the geom_raster_fallback branch May 20, 2024 09:32
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.

Should geom_raster() fall back to geom_rect() under non-linear coordinates?
2 participants