{"action":"created","comment":{"url":"https://api.github.com/repos/hadley/ggplot2/pulls/comments/56193528","id":56193528,"diff_hunk":"@@ -4,6 +4,19 @@\n   aesthetics they accept: `xmin_final`, `xmax_final`, `xlower`,\n   `xmiddle` and `xupper` are now valid `x` aesthetics.\n \n+* `ggtitle()` and `labs()` take a `subtitle` parameter which makes it ","path":"NEWS.md","position":4,"original_position":4,"commit_id":"9a12c2cd10fab9127fc6e1a4bc51687531f85f9b","original_commit_id":"9a12c2cd10fab9127fc6e1a4bc51687531f85f9b","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},"body":"One last thing - can you please credit yourself here, i.e. `(@hrbmstr)`","created_at":"2016-03-15T16:25:07Z","updated_at":"2016-03-15T16:25:07Z","html_url":"https://github.com/hadley/ggplot2/pull/1582#discussion_r56193528","pull_request_url":"https://api.github.com/repos/hadley/ggplot2/pulls/1582","_links":{"self":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/comments/56193528"},"html":{"href":"https://github.com/hadley/ggplot2/pull/1582#discussion_r56193528"},"pull_request":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1582"}}},"pull_request":{"url":"https://api.github.com/repos/hadley/ggplot2/pulls/1582","id":62677860,"html_url":"https://github.com/hadley/ggplot2/pull/1582","diff_url":"https://github.com/hadley/ggplot2/pull/1582.diff","patch_url":"https://github.com/hadley/ggplot2/pull/1582.patch","issue_url":"https://api.github.com/repos/hadley/ggplot2/issues/1582","number":1582,"state":"open","locked":false,"title":"Subtitles for ggplot2","user":{"login":"hrbrmstr","id":509878,"avatar_url":"https://avatars.githubusercontent.com/u/509878?v=3","gravatar_id":"","url":"https://api.github.com/users/hrbrmstr","html_url":"https://github.com/hrbrmstr","followers_url":"https://api.github.com/users/hrbrmstr/followers","following_url":"https://api.github.com/users/hrbrmstr/following{/other_user}","gists_url":"https://api.github.com/users/hrbrmstr/gists{/gist_id}","starred_url":"https://api.github.com/users/hrbrmstr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrbrmstr/subscriptions","organizations_url":"https://api.github.com/users/hrbrmstr/orgs","repos_url":"https://api.github.com/users/hrbrmstr/repos","events_url":"https://api.github.com/users/hrbrmstr/events{/privacy}","received_events_url":"https://api.github.com/users/hrbrmstr/received_events","type":"User","site_admin":false},"body":"- new `subtitle` parameter for `labs` and `ggtitle`\r\n- documented the `subtitle` parameter in `ggtitle` since it's an explicit parameter\r\n- new `caption` parameter for `labs` function\r\n- new `plot.subtitle` theme element\r\n- new `plot.caption` theme element (default alignment is right-justified)\r\n- updated default alignment for `plot.title` and `plot.subtitle` (now left-justified by default)\r\n- updated roxygen documentation with `subtitle` and `caption` examples\r\n- added test for `title`, `subtitle` & `caption` settings\r\n- cleaned up `=` spacing in a few other files since they came up when I was trying to fix my own :-)\r\n- updated `NEWS.md` (including suggested fixes to `NEWS.md`)\r\n\r\nSample code to validate non-breakage (i.e. test with various plot elements):\r\n\r\n```\r\nlibrary(ggplot2)\r\nlibrary(gridExtra)\r\n\r\nst <- \"Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all people are created equal.\"\r\nst <- paste0(strwrap(st, 70), sep=\"\", collapse=\"\\n\")\r\n\r\np <- ggplot(mtcars, aes(wt, mpg))\r\np <- p + geom_point(aes(color=factor(cyl)))\r\n\r\n# Changing the font solely to validate functionality. Times. Ugh.\r\np <- p + theme(text=element_text(family=\"Times\"))\r\np <- p + theme(plot.title=element_text(face=\"bold\"))\r\np <- p + theme(plot.subtitle=element_text(margin=margin(b=15)))\r\np <- p + theme(plot.caption=element_text(margin=margin(t=15),\r\n                                        face=\"italic\", size=8))\r\ngrid.arrange(\r\n  \r\n  p + ggtitle(\"Just ggtitle\"),\r\n  \r\n  p + labs(title=\"Just labs with title\"),\r\n  \r\n  p + ggtitle(\"Now ggtitle with title subtitle\", subtitle=st),\r\n  \r\n  # More tests --------------------------------------------------------------\r\n  \r\n  p + labs(title=\"Now labs with title subtitle\", subtitle=st) +\r\n    theme(legend.position=\"top\"),\r\n  \r\n  p + labs(title=\"Two separate labs calls for each title\") +\r\n    labs(subtitle=st) +\r\n    theme(legend.position=\"bottom\"),\r\n  \r\n  p + facet_wrap(~cyl) +\r\n    labs(title=\"Works with facets too\",\r\n         subtitle=st,\r\n         caption=\"Brought you by the letters 'gg'\"),\r\n  \r\n  # below -------------------------------------------------------------------\r\n  \r\n  p + labs(title=\"Now labs with title subtitle & below\",\r\n           subtitle=st,\r\n           source=\"Brought you by the letters 'gg'\"),\r\n  \r\n  p + labs(title=\"Two separate labs calls for each title & below\") +\r\n    labs(subtitle=st) +\r\n    labs(caption=\"Brought you by the letters 'gg'\") +\r\n    theme(legend.position=\"bottom\"),\r\n  \r\n  p + facet_wrap(~cyl) +\r\n    labs(title=\"Works with facets too & below\",\r\n         subtitle=st,\r\n         caption=\"Brought you by the letters 'gg'\"),\r\n  \r\n  ncol=3\r\n  \r\n)\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/509878/13785028/02e4aa80-eaa8-11e5-892f-da895c832582.png)\r\n\r\n","created_at":"2016-03-13T17:59:22Z","updated_at":"2016-03-15T16:25:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ae26110ff9fdbed1c50eb5e4afb746b5da44efd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hadley/ggplot2/pulls/1582/commits","review_comments_url":"https://api.github.com/repos/hadley/ggplot2/pulls/1582/comments","review_comment_url":"https://api.github.com/repos/hadley/ggplot2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hadley/ggplot2/issues/1582/comments","statuses_url":"https://api.github.com/repos/hadley/ggplot2/statuses/9a12c2cd10fab9127fc6e1a4bc51687531f85f9b","head":{"label":"hrbrmstr:master","ref":"master","sha":"9a12c2cd10fab9127fc6e1a4bc51687531f85f9b","user":{"login":"hrbrmstr","id":509878,"avatar_url":"https://avatars.githubusercontent.com/u/509878?v=3","gravatar_id":"","url":"https://api.github.com/users/hrbrmstr","html_url":"https://github.com/hrbrmstr","followers_url":"https://api.github.com/users/hrbrmstr/followers","following_url":"https://api.github.com/users/hrbrmstr/following{/other_user}","gists_url":"https://api.github.com/users/hrbrmstr/gists{/gist_id}","starred_url":"https://api.github.com/users/hrbrmstr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrbrmstr/subscriptions","organizations_url":"https://api.github.com/users/hrbrmstr/orgs","repos_url":"https://api.github.com/users/hrbrmstr/repos","events_url":"https://api.github.com/users/hrbrmstr/events{/privacy}","received_events_url":"https://api.github.com/users/hrbrmstr/received_events","type":"User","site_admin":false},"repo":{"id":53795240,"name":"ggplot2","full_name":"hrbrmstr/ggplot2","owner":{"login":"hrbrmstr","id":509878,"avatar_url":"https://avatars.githubusercontent.com/u/509878?v=3","gravatar_id":"","url":"https://api.github.com/users/hrbrmstr","html_url":"https://github.com/hrbrmstr","followers_url":"https://api.github.com/users/hrbrmstr/followers","following_url":"https://api.github.com/users/hrbrmstr/following{/other_user}","gists_url":"https://api.github.com/users/hrbrmstr/gists{/gist_id}","starred_url":"https://api.github.com/users/hrbrmstr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrbrmstr/subscriptions","organizations_url":"https://api.github.com/users/hrbrmstr/orgs","repos_url":"https://api.github.com/users/hrbrmstr/repos","events_url":"https://api.github.com/users/hrbrmstr/events{/privacy}","received_events_url":"https://api.github.com/users/hrbrmstr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hrbrmstr/ggplot2","description":"An implementation of the Grammar of Graphics in R","fork":true,"url":"https://api.github.com/repos/hrbrmstr/ggplot2","forks_url":"https://api.github.com/repos/hrbrmstr/ggplot2/forks","keys_url":"https://api.github.com/repos/hrbrmstr/ggplot2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hrbrmstr/ggplot2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hrbrmstr/ggplot2/teams","hooks_url":"https://api.github.com/repos/hrbrmstr/ggplot2/hooks","issue_events_url":"https://api.github.com/repos/hrbrmstr/ggplot2/issues/events{/number}","events_url":"https://api.github.com/repos/hrbrmstr/ggplot2/events","assignees_url":"https://api.github.com/repos/hrbrmstr/ggplot2/assignees{/user}","branches_url":"https://api.github.com/repos/hrbrmstr/ggplot2/branches{/branch}","tags_url":"https://api.github.com/repos/hrbrmstr/ggplot2/tags","blobs_url":"https://api.github.com/repos/hrbrmstr/ggplot2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hrbrmstr/ggplot2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hrbrmstr/ggplot2/git/refs{/sha}","trees_url":"https://api.github.com/repos/hrbrmstr/ggplot2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hrbrmstr/ggplot2/statuses/{sha}","languages_url":"https://api.github.com/repos/hrbrmstr/ggplot2/languages","stargazers_url":"https://api.github.com/repos/hrbrmstr/ggplot2/stargazers","contributors_url":"https://api.github.com/repos/hrbrmstr/ggplot2/contributors","subscribers_url":"https://api.github.com/repos/hrbrmstr/ggplot2/subscribers","subscription_url":"https://api.github.com/repos/hrbrmstr/ggplot2/subscription","commits_url":"https://api.github.com/repos/hrbrmstr/ggplot2/commits{/sha}","git_commits_url":"https://api.github.com/repos/hrbrmstr/ggplot2/git/commits{/sha}","comments_url":"https://api.github.com/repos/hrbrmstr/ggplot2/comments{/number}","issue_comment_url":"https://api.github.com/repos/hrbrmstr/ggplot2/issues/comments{/number}","contents_url":"https://api.github.com/repos/hrbrmstr/ggplot2/contents/{+path}","compare_url":"https://api.github.com/repos/hrbrmstr/ggplot2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hrbrmstr/ggplot2/merges","archive_url":"https://api.github.com/repos/hrbrmstr/ggplot2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hrbrmstr/ggplot2/downloads","issues_url":"https://api.github.com/repos/hrbrmstr/ggplot2/issues{/number}","pulls_url":"https://api.github.com/repos/hrbrmstr/ggplot2/pulls{/number}","milestones_url":"https://api.github.com/repos/hrbrmstr/ggplot2/milestones{/number}","notifications_url":"https://api.github.com/repos/hrbrmstr/ggplot2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hrbrmstr/ggplot2/labels{/name}","releases_url":"https://api.github.com/repos/hrbrmstr/ggplot2/releases{/id}","deployments_url":"https://api.github.com/repos/hrbrmstr/ggplot2/deployments","created_at":"2016-03-13T16:30:01Z","updated_at":"2016-03-13T16:30:02Z","pushed_at":"2016-03-15T16:17:53Z","git_url":"git://github.com/hrbrmstr/ggplot2.git","ssh_url":"git@github.com:hrbrmstr/ggplot2.git","clone_url":"https://github.com/hrbrmstr/ggplot2.git","svn_url":"https://github.com/hrbrmstr/ggplot2","homepage":"http://ggplot2.org","size":24043,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hadley:master","ref":"master","sha":"7edcea4b578fd4add169634ef42c51d79095fdaa","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-03-14T13:51:59Z","pushed_at":"2016-03-15T16:17:30Z","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":26432,"stargazers_count":1711,"watchers_count":1711,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":658,"mirror_url":null,"open_issues_count":36,"forks":658,"open_issues":36,"watchers":1711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1582"},"html":{"href":"https://github.com/hadley/ggplot2/pull/1582"},"issue":{"href":"https://api.github.com/repos/hadley/ggplot2/issues/1582"},"comments":{"href":"https://api.github.com/repos/hadley/ggplot2/issues/1582/comments"},"review_comments":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1582/comments"},"review_comment":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hadley/ggplot2/pulls/1582/commits"},"statuses":{"href":"https://api.github.com/repos/hadley/ggplot2/statuses/9a12c2cd10fab9127fc6e1a4bc51687531f85f9b"}}}}