{"action":"opened","number":1760,"pull_request":{"url":"https://api.github.com/repos/hadley/ggplot2/pulls/1760","id":85808602,"html_url":"https://github.com/hadley/ggplot2/pull/1760","diff_url":"https://github.com/hadley/ggplot2/pull/1760.diff","patch_url":"https://github.com/hadley/ggplot2/pull/1760.patch","issue_url":"https://api.github.com/repos/hadley/ggplot2/issues/1760","number":1760,"state":"open","locked":false,"title":"show.legend can now be a logical vector","user":{"login":"Tutuchan","id":5540005,"avatar_url":"https://avatars.githubusercontent.com/u/5540005?v=3","gravatar_id":"","url":"https://api.github.com/users/Tutuchan","html_url":"https://github.com/Tutuchan","followers_url":"https://api.github.com/users/Tutuchan/followers","following_url":"https://api.github.com/users/Tutuchan/following{/other_user}","gists_url":"https://api.github.com/users/Tutuchan/gists{/gist_id}","starred_url":"https://api.github.com/users/Tutuchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tutuchan/subscriptions","organizations_url":"https://api.github.com/users/Tutuchan/orgs","repos_url":"https://api.github.com/users/Tutuchan/repos","events_url":"https://api.github.com/users/Tutuchan/events{/privacy}","received_events_url":"https://api.github.com/users/Tutuchan/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nWith this PR, it is now possible to pass a named logical vector to `show.legend` in order to have better control of what appears in the legend or not. See this example: \r\n\r\n```r\r\nlibrary(ggplot2)\r\n\r\np <- ggplot(mtcars) +\r\n  geom_point(aes(mpg, qsec, colour = factor(vs), shape = factor(am)))\r\n\r\np + geom_line(aes(mpg, qsec, colour = factor(vs), linetype = factor(am)))\r\n\r\n# Current behaviour: remove this layer from the legend\r\np + geom_line(aes(mpg, qsec, colour = factor(vs), linetype = factor(am)), show.legend = FALSE)\r\n\r\n# In the current version, this would have the same behaviour but here, \r\n# it removes only the colour aesthetic for the line geom from the legend\r\np + geom_line(aes(mpg, qsec, colour = factor(vs), linetype = factor(am)), \r\n              show.legend = c(colour = FALSE))\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5540005/18636453/2c7300ca-7e89-11e6-8398-ae3378826ccb.png)\r\n\r\nThe only problem (that I see anyway) is that, for the colour scale, the name in the `show.legend` vector **must** be `colour`, `color` will not work. It might be solved by adding a check when trying to match the names but it's not very elegant. Any ideas ?","created_at":"2016-09-19T14:53:04Z","updated_at":"2016-09-19T14:53:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hadley/ggplot2/pulls/1760/commits","review_comments_url":"https://api.github.com/repos/hadley/ggplot2/pulls/1760/comments","review_comment_url":"https://api.github.com/repos/hadley/ggplot2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hadley/ggplot2/issues/1760/comments","statuses_url":"https://api.github.com/repos/hadley/ggplot2/statuses/887e90e135a5f9033a9c73f9779decc23c9f2e96","head":{"label":"Tutuchan:feature/vector-show-legend","ref":"feature/vector-show-legend","sha":"887e90e135a5f9033a9c73f9779decc23c9f2e96","user":{"login":"Tutuchan","id":5540005,"avatar_url":"https://avatars.githubusercontent.com/u/5540005?v=3","gravatar_id":"","url":"https://api.github.com/users/Tutuchan","html_url":"https://github.com/Tutuchan","followers_url":"https://api.github.com/users/Tutuchan/followers","following_url":"https://api.github.com/users/Tutuchan/following{/other_user}","gists_url":"https://api.github.com/users/Tutuchan/gists{/gist_id}","starred_url":"https://api.github.com/users/Tutuchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tutuchan/subscriptions","organizations_url":"https://api.github.com/users/Tutuchan/orgs","repos_url":"https://api.github.com/users/Tutuchan/repos","events_url":"https://api.github.com/users/Tutuchan/events{/privacy}","received_events_url":"https://api.github.com/users/Tutuchan/received_events","type":"User","site_admin":false},"repo":{"id":68604247,"name":"ggplot2","full_name":"Tutuchan/ggplot2","owner":{"login":"Tutuchan","id":5540005,"avatar_url":"https://avatars.githubusercontent.com/u/5540005?v=3","gravatar_id":"","url":"https://api.github.com/users/Tutuchan","html_url":"https://github.com/Tutuchan","followers_url":"https://api.github.com/users/Tutuchan/followers","following_url":"https://api.github.com/users/Tutuchan/following{/other_user}","gists_url":"https://api.github.com/users/Tutuchan/gists{/gist_id}","starred_url":"https://api.github.com/users/Tutuchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tutuchan/subscriptions","organizations_url":"https://api.github.com/users/Tutuchan/orgs","repos_url":"https://api.github.com/users/Tutuchan/repos","events_url":"https://api.github.com/users/Tutuchan/events{/privacy}","received_events_url":"https://api.github.com/users/Tutuchan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tutuchan/ggplot2","description":"An implementation of the Grammar of Graphics in R","fork":true,"url":"https://api.github.com/repos/Tutuchan/ggplot2","forks_url":"https://api.github.com/repos/Tutuchan/ggplot2/forks","keys_url":"https://api.github.com/repos/Tutuchan/ggplot2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tutuchan/ggplot2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tutuchan/ggplot2/teams","hooks_url":"https://api.github.com/repos/Tutuchan/ggplot2/hooks","issue_events_url":"https://api.github.com/repos/Tutuchan/ggplot2/issues/events{/number}","events_url":"https://api.github.com/repos/Tutuchan/ggplot2/events","assignees_url":"https://api.github.com/repos/Tutuchan/ggplot2/assignees{/user}","branches_url":"https://api.github.com/repos/Tutuchan/ggplot2/branches{/branch}","tags_url":"https://api.github.com/repos/Tutuchan/ggplot2/tags","blobs_url":"https://api.github.com/repos/Tutuchan/ggplot2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tutuchan/ggplot2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tutuchan/ggplot2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tutuchan/ggplot2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tutuchan/ggplot2/statuses/{sha}","languages_url":"https://api.github.com/repos/Tutuchan/ggplot2/languages","stargazers_url":"https://api.github.com/repos/Tutuchan/ggplot2/stargazers","contributors_url":"https://api.github.com/repos/Tutuchan/ggplot2/contributors","subscribers_url":"https://api.github.com/repos/Tutuchan/ggplot2/subscribers","subscription_url":"https://api.github.com/repos/Tutuchan/ggplot2/subscription","commits_url":"https://api.github.com/repos/Tutuchan/ggplot2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tutuchan/ggplot2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tutuchan/ggplot2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tutuchan/ggplot2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tutuchan/ggplot2/contents/{+path}","compare_url":"https://api.github.com/repos/Tutuchan/ggplot2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tutuchan/ggplot2/merges","archive_url":"https://api.github.com/repos/Tutuchan/ggplot2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tutuchan/ggplot2/downloads","issues_url":"https://api.github.com/repos/Tutuchan/ggplot2/issues{/number}","pulls_url":"https://api.github.com/repos/Tutuchan/ggplot2/pulls{/number}","milestones_url":"https://api.github.com/repos/Tutuchan/ggplot2/milestones{/number}","notifications_url":"https://api.github.com/repos/Tutuchan/ggplot2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tutuchan/ggplot2/labels{/name}","releases_url":"https://api.github.com/repos/Tutuchan/ggplot2/releases{/id}","deployments_url":"https://api.github.com/repos/Tutuchan/ggplot2/deployments","created_at":"2016-09-19T12:36:56Z","updated_at":"2016-09-19T12:36:58Z","pushed_at":"2016-09-19T14:36:12Z","git_url":"git://github.com/Tutuchan/ggplot2.git","ssh_url":"git@github.com:Tutuchan/ggplot2.git","clone_url":"https://github.com/Tutuchan/ggplot2.git","svn_url":"https://github.com/Tutuchan/ggplot2","homepage":"http://ggplot2.org","size":23708,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hadley:master","ref":"master","sha":"2eee836f8db27b1cb02cf43a3242fc1d3cc9b89b","user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"repo":{"id":19438,"name":"ggplot2","full_name":"hadley/ggplot2","owner":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hadley/ggplot2","description":"An implementation of the Grammar of Graphics in R","fork":false,"url":"https://api.github.com/repos/hadley/ggplot2","forks_url":"https://api.github.com/repos/hadley/ggplot2/forks","keys_url":"https://api.github.com/repos/hadley/ggplot2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hadley/ggplot2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hadley/ggplot2/teams","hooks_url":"https://api.github.com/repos/hadley/ggplot2/hooks","issue_events_url":"https://api.github.com/repos/hadley/ggplot2/issues/events{/number}","events_url":"https://api.github.com/repos/hadley/ggplot2/events","assignees_url":"https://api.github.com/repos/hadley/ggplot2/assignees{/user}","branches_url":"https://api.github.com/repos/hadley/ggplot2/branches{/branch}","tags_url":"https://api.github.com/repos/hadley/ggplot2/tags","blobs_url":"https://api.github.com/repos/hadley/ggplot2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hadley/ggplot2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hadley/ggplot2/git/refs{/sha}","trees_url":"https://api.github.com/repos/hadley/ggplot2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hadley/ggplot2/statuses/{sha}","languages_url":"https://api.github.com/repos/hadley/ggplot2/languages","stargazers_url":"https://api.github.com/repos/hadley/ggplot2/stargazers","contributors_url":"https://api.github.com/repos/hadley/ggplot2/contributors","subscribers_url":"https://api.github.com/repos/hadley/ggplot2/subscribers","subscription_url":"https://api.github.com/repos/hadley/ggplot2/subscription","commits_url":"https://api.github.com/repos/hadley/ggplot2/commits{/sha}","git_commits_url":"https://api.github.com/repos/hadley/ggplot2/git/commits{/sha}","comments_url":"https://api.github.com/repos/hadley/ggplot2/comments{/number}","issue_comment_url":"https://api.github.com/repos/hadley/ggplot2/issues/comments{/number}","contents_url":"https://api.github.com/repos/hadley/ggplot2/contents/{+path}","compare_url":"https://api.github.com/repos/hadley/ggplot2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hadley/ggplot2/merges","archive_url":"https://api.github.com/repos/hadley/ggplot2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hadley/ggplot2/downloads","issues_url":"https://api.github.com/repos/hadley/ggplot2/issues{/number}","pulls_url":"https://api.github.com/repos/hadley/ggplot2/pulls{/number}","milestones_url":"https://api.github.com/repos/hadley/ggplot2/milestones{/number}","notifications_url":"https://api.github.com/repos/hadley/ggplot2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hadley/ggplot2/labels{/name}","releases_url":"https://api.github.com/repos/hadley/ggplot2/releases{/id}","deployments_url":"https://api.github.com/repos/hadley/ggplot2/deployments","created_at":"2008-05-25T01:21:32Z","updated_at":"2016-09-18T21:49:43Z","pushed_at":"2016-09-19T09:31:24Z","git_url":"git://github.com/hadley/ggplot2.git","ssh_url":"git@github.com:hadley/ggplot2.git","clone_url":"https://github.com/hadley/ggplot2.git","svn_url":"https://github.com/hadley/ggplot2","homepage":"http://ggplot2.org","size":30006,"stargazers_count":2012,"watchers_count":2012,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":757,"mirror_url":null,"open_issues_count":41,"forks":757,"open_issues":41,"watchers":2012,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1760"},"html":{"href":"https://github.com/hadley/ggplot2/pull/1760"},"issue":{"href":"https://api.github.com/repos/hadley/ggplot2/issues/1760"},"comments":{"href":"https://api.github.com/repos/hadley/ggplot2/issues/1760/comments"},"review_comments":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1760/comments"},"review_comment":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1760/commits"},"statuses":{"href":"https://api.github.com/repos/hadley/ggplot2/statuses/887e90e135a5f9033a9c73f9779decc23c9f2e96"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":101,"deletions":42,"changed_files":42}}
{"actor":{"display_login":"Tutuchan"}}