Skip to content

geom_ribbon() doesn't handle fill/colour/group properly #192

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

Closed
cpsievert opened this issue Mar 18, 2015 · 0 comments
Closed

geom_ribbon() doesn't handle fill/colour/group properly #192

cpsievert opened this issue Mar 18, 2015 · 0 comments
Assignees

Comments

@cpsievert
Copy link
Collaborator

Consider the following:

huron <- data.frame(year = 1875:1972, level = as.vector(LakeHuron))
library(plyr) # to access round_any
huron$decade <- round_any(huron$year, 10, floor)
huron$diff <- huron$year - huron$decade
p1 <- ggplot(data = huron, aes(fill = factor(decade))) + 
  geom_ribbon(aes(x = diff, ymin = level-0.1, ymax = level+0.1))
p1

rplot01

However the plotly result is:

Also,

p2 <- ggplot(data = huron, aes(colour = factor(decade))) + 
  geom_ribbon(aes(x = diff, ymin = level-0.1, ymax = level+0.1))
p2

rplot02

And the plotly result is the same as before...

@tdhock suggested here that we treat ribbons as a special case of polygons (as he has done with geom_rect)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant