Skip to content

Legend hiding rules a bit too strict? #212

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 Apr 30, 2015 · 4 comments
Closed

Legend hiding rules a bit too strict? #212

cpsievert opened this issue Apr 30, 2015 · 4 comments
Assignees

Comments

@cpsievert
Copy link
Collaborator

I discovered this example via the checkmark on #161 titled "geom_rect()"

This works fine:

base <- ggplot(mtcars) + 
  geom_density(aes(x=disp, group=cyl, fill=factor(cyl)), alpha=0.6, adjust=0.75) 

But once I add a "rect layer", the legend goes away (it shouldn't):

base + annotate("rect", xmin=100, xmax=200, ymin=0, ymax=0.02, alpha=0.2, fill="red")

@13bzhang
Copy link
Contributor

13bzhang commented Jun 7, 2015

Now that you mentioned it in #225, I shall take a look.

@13bzhang
Copy link
Contributor

Interesting. When I ran the same code as you for the first plot, I did not get the legends -- could be a change in the code since April 30.

density-vs-disp_bad

@13bzhang
Copy link
Contributor

Legends have been turned off for boxplots as well. At least they are not off for barcharts.

m <- ggplot(mtcars, aes(factor(cyl), mpg))
p <- m + geom_boxplot(aes(fill = factor(cyl)))
py$ggplotly(p)

ggplot2

boxplot_good

plotly

boxplot_bad

@cpsievert
Copy link
Collaborator Author

Fixed via 5509909

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

No branches or pull requests

2 participants