{"action":"closed","issue":{"url":"https://api.github.com/repos/ropensci/plotly/issues/212","labels_url":"https://api.github.com/repos/ropensci/plotly/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/ropensci/plotly/issues/212/comments","events_url":"https://api.github.com/repos/ropensci/plotly/issues/212/events","html_url":"https://github.com/ropensci/plotly/issues/212","id":72204561,"number":212,"title":"Legend hiding rules a bit too strict?","user":{"login":"cpsievert","id":1365941,"avatar_url":"https://avatars.githubusercontent.com/u/1365941?v=3","gravatar_id":"","url":"https://api.github.com/users/cpsievert","html_url":"https://github.com/cpsievert","followers_url":"https://api.github.com/users/cpsievert/followers","following_url":"https://api.github.com/users/cpsievert/following{/other_user}","gists_url":"https://api.github.com/users/cpsievert/gists{/gist_id}","starred_url":"https://api.github.com/users/cpsievert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpsievert/subscriptions","organizations_url":"https://api.github.com/users/cpsievert/orgs","repos_url":"https://api.github.com/users/cpsievert/repos","events_url":"https://api.github.com/users/cpsievert/events{/privacy}","received_events_url":"https://api.github.com/users/cpsievert/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"13bzhang","id":6131842,"avatar_url":"https://avatars.githubusercontent.com/u/6131842?v=3","gravatar_id":"","url":"https://api.github.com/users/13bzhang","html_url":"https://github.com/13bzhang","followers_url":"https://api.github.com/users/13bzhang/followers","following_url":"https://api.github.com/users/13bzhang/following{/other_user}","gists_url":"https://api.github.com/users/13bzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/13bzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/13bzhang/subscriptions","organizations_url":"https://api.github.com/users/13bzhang/orgs","repos_url":"https://api.github.com/users/13bzhang/repos","events_url":"https://api.github.com/users/13bzhang/events{/privacy}","received_events_url":"https://api.github.com/users/13bzhang/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-04-30T16:04:10Z","updated_at":"2015-12-14T00:20:03Z","closed_at":"2015-12-14T00:20:03Z","body":"I discovered [this example](http://stackoverflow.com/questions/17521438/geom-rect-and-alpha-does-this-work-with-hard-coded-values) via the checkmark on #161 titled \"geom_rect()\"\r\n\r\nThis works fine:\r\n\r\n```r\r\nbase <- ggplot(mtcars) + \r\n  geom_density(aes(x=disp, group=cyl, fill=factor(cyl)), alpha=0.6, adjust=0.75) \r\n```\r\n\r\n![](https://plot.ly/~cpsievert/532/density-vs-disp.png)\r\n\r\nBut once I add a \"rect layer\", the legend goes away (it shouldn't):\r\n\r\n```r\r\nbase + annotate(\"rect\", xmin=100, xmax=200, ymin=0, ymax=0.02, alpha=0.2, fill=\"red\")\r\n```\r\n\r\n![](https://plot.ly/~cpsievert/531/density-vs-disp.png)"}}