

{"id":4133,"date":"2016-03-16T07:47:02","date_gmt":"2016-03-16T12:47:02","guid":{"rendered":"http:\/\/rud.is\/b\/?p=4133"},"modified":"2018-06-26T12:52:43","modified_gmt":"2018-06-26T17:52:43","slug":"supreme-annotations","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/","title":{"rendered":"Supreme Annotations"},"content":{"rendered":"<blockquote><p>\n  <em>This is a follow up to a twitter-gist post &amp; to the annotation party we&#8217;re having this week<\/em>\n<\/p><\/blockquote>\n<p>I had not intended this to be &#8220;Annotation Week&#8221; but there was a large, positive response to my annotation &#8220;hack&#8221; post. This reaction surprised me, then someone pointed me to <a href=\"http:\/\/stackoverflow.com\/search?q=%5Br%5D+%5Bggplot2%5D+subtitle\">this link<\/a> and also noted that if having to do subtitles via hacks or Illustrator annoyed me, imagine the reaction to people who actually do real work. That led me to pull up my <code>ggplot2<\/code> fork (what, you don&#8217;t keep a fork of <code>ggplot2<\/code> handy, too?) and work out how to augment <code>ggplot2<\/code>-proper with the functionality. It&#8217;s yet-another nod to Hadley as he designed the package <em>so well<\/em> that slipping in annotations to the label, theme &amp; plot-building code was an actual <em>magical<\/em> experience. As I was doing this, @janschulz jumped in to add below-plot annotations to <code>ggplot2<\/code> (which we&#8217;re calling the <code>caption<\/code> label thanks to a suggestion by @arnicas).<\/p>\n<h3>What&#8217;s Changed?<\/h3>\n<p>There are two new plot label components. The first is for subtitles that appear below the plot title. You can either do:<\/p>\n<pre><code class=\"language-r\">\nggtitle(\"The Main Title\", subtitle=\"A well-crafted subtitle\")\n<\/code><\/pre>\n<p>or<\/p>\n<pre><code class=\"language-r\">\nlabs(title=\"The Main Title\", subtitle=\"A well-crafted subtitle\")\n<\/code><\/pre>\n<p>The second is for below-plot annotations (captions), which are added via:<\/p>\n<pre><code class=\"language-r\">\nlabs(title=\"Main Title\", caption=\"Where this crazy thing game from\")\n<\/code><\/pre>\n<p>These are styled via two new <code>theme<\/code> elements (both adjusted with <code>element_text()<\/code>):<\/p>\n<ul>\n<li><code>plot.subtitle<\/code><\/li>\n<li><code>plot.caption<\/code><\/li>\n<\/ul>\n<p>A &#8220;casualty&#8221; of these changes is that the main <code>plot.title<\/code> is now <em>left-justified<\/em> by default (as is <code>plot.subtitle<\/code>). <code>plot.caption<\/code> is right-justified by default.<\/p>\n<h3>Yet-another ggplot2 Example<\/h3>\n<p>I have thoughts on plot typography which I&#8217;ll save for another post, but I wanted to show how to use these new components. You&#8217;ll need to <code>devtools::install_github(\"hadley\/ggplot2\")<\/code> to use them until the changes get into CRAN.<\/p>\n<p>I came across this chart from the Pew Research Center on U.S. Supreme Court &#8220;wait times&#8221; this week:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes-pew.png?ssl=1\" rel=\"attachment wp-att-4136\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"391\" data-attachment-id=\"4136\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/supremes-pew\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes-pew.png?fit=1270%2C974&amp;ssl=1\" data-orig-size=\"1270,974\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"supremes-pew\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes-pew.png?fit=510%2C391&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes-pew.png?resize=510%2C391&#038;ssl=1\" alt=\"supremes-pew\" class=\"aligncenter size-full wp-image-4136\" \/><\/a><\/p>\n<p>It seemed like a good candidate to test out the new <code>ggplot2<\/code> additions. <em>However<\/em>, while Pew provided the chart, they did not provide data behind it. So, <em>just for you<\/em>, I used <a href=\"http:\/\/arohatgi.info\/WebPlotDigitizer\/\">WebPlotDigitizer<\/a> to encode the points (making good use of a commuter train home). Some points are (no doubt) off by one or two, but precision was not necessary for this riff. The data (and code) are in <a href=\"https:\/\/gist.github.com\/hrbrmstr\/283850725519e502e70c\">this gist<\/a>. First the data.<\/p>\n<pre><code class=\"language-r\">\nlibrary(ggplot2)\n\ndat <- read.csv(\"supreme_court_vacancies.csv\", col.names=c(\"year\", \"wait\"))\n<\/code><\/pre>\n<p>Now, we want to reproduce the original chart \"theme\" pretty closely, so I've done quite a bit of styling outside of the subtitle\/caption. One thing we can take care of right away is how to only label every other tick:<\/p>\n<pre><code class=\"language-r\">xlabs <- seq(1780, 2020, by=10)\nxlabs[seq(2, 24, by=2)]  <-  \" \"<\/code><\/pre>\n<p>Now we setup the caption. It's <em>long<\/em>, so we need to wrap it (you need to play with the number of characters value to suit your needs). There's a Shiny Gadget (which is moving to the <code>ggThemeAssist<\/code> package) to help with this.<\/p>\n<pre><code class=\"language-r\">\ncaption <- \"Note: Vacancies are counted as the number of days between a justice's death, retirement or resignation and the successor justice's swearing in (or commissioning in the case of a recess appointment) as a member of the court.Sources: U.S. Senate, 'Supreme Court Nominations, present-1789'; Supreme Court, 'Members of the Supreme Court of the United States'; Pew Research Center calculations\"\ncaption <- paste0(strwrap(caption, 160), sep=\"\", collapse=\"\\n\")\n# NOTE: you could probably just use caption <- label_wrap_gen(160)(caption) instead\n<\/code><\/pre>\n<p>We're going to try to fully reproduce all the annotations, so here are the in-plot point labels. (Adding the lines is an exercise left to the reader.)<\/p>\n<pre><code class=\"language-r\">\nannot <- read.table(text=\n\"year|wait|just|text\n1848|860|0|Robert Cooper Grier was sworn in Aug 10, 1846,<br>841 days after the death of Henry Baldwin\n1969|440|1|Henry Blackmun was sworn<br>in June 9, 1970, 391 days<br>after Abe Fortas resigned.\n1990|290|0|Anthony Kennedy<br>was sworn in Feb.<br>18, 1988, 237<br>days after Lewis<br>Powell retired.\",\nsep=\"|\", header=TRUE, stringsAsFactors=FALSE)\nannot$text <- gsub(\"<br>\", \"\\n\", annot$text)<\/code><\/pre>\n<p>Now the fun begins.<\/p>\n<pre><code class=\"language-r\">\ngg <- ggplot()\ngg <- gg + geom_point(data=dat, aes(x=year, y=wait))\n<\/code><\/pre>\n<p>We'll add the y-axis \"title\" to the inside of the plot:<\/p>\n<pre><code class=\"language-r\">\ngg <- gg + geom_label(aes(x=1780, y=900, label=\"days\"),\n                      family=\"OpenSans-CondensedLight\",\n                      size=3.5, hjust=0, label.size=0, color=\"#2b2b2b\")\n<\/code><\/pre>\n<p>Now, we add our lovingly hand-crafted in-plot annotations:<\/p>\n<pre><code class=\"language-r\">\ngg <- gg + geom_label(data=annot, aes(x=year, y=wait, label=text, hjust=just),\n                      family=\"OpenSans-CondensedLight\", lineheight=0.95,\n                      size=3, label.size=0, color=\"#2b2b2b\")\n<\/code><\/pre>\n<p>Then, tweak the axes:<\/p>\n<pre><code class=\"language-r\">\ngg <- gg + scale_x_continuous(expand=c(0,0),\n                              breaks=seq(1780, 2020, by=10),\n                              labels=xlabs, limits=c(1780,2020))\ngg <- gg + scale_y_continuous(expand=c(0,10),\n                              breaks=seq(100, 900, by=100),\n                              limits=c(0, 1000))\n<\/code><\/pre>\n<p>Thanks to Hadley's package design &amp; Jan's &amp; my additions, this is all you need to do to add the subtitle &amp; caption:<\/p>\n<pre><code class=\"language-r\">\ngg <- gg + labs(x=NULL, y=NULL,\n                title=\"Lengthy Supreme Court vacancies are rare now, but weren't always\",\n                subtitle=\"Supreme Court vacancies, by duration\",\n                caption=caption)\n<\/code><\/pre>\n<p>Well, perhaps not all since we need to style this puppy. You'll either need to install the font from Google Fonts or sub out the fonts for something you have.<\/p>\n<pre><code class=\"language-r\">\ngg <- gg + theme_minimal(base_family=\"OpenSans-CondensedLight\")\n# light, dotted major y-grid lines only\ngg <- gg + theme(panel.grid=element_line())\ngg <- gg + theme(panel.grid.major.y=element_line(color=\"#2b2b2b\", linetype=\"dotted\", size=0.15))\ngg <- gg + theme(panel.grid.major.x=element_blank())\ngg <- gg + theme(panel.grid.minor.x=element_blank())\ngg <- gg + theme(panel.grid.minor.y=element_blank())\n# light x-axis line only\ngg <- gg + theme(axis.line=element_line())\ngg <- gg + theme(axis.line.x=element_line(color=\"#2b2b2b\", size=0.15))\n# tick styling\ngg <- gg + theme(axis.ticks=element_line())\ngg <- gg + theme(axis.ticks.x=element_line(color=\"#2b2b2b\", size=0.15))\ngg <- gg + theme(axis.ticks.y=element_blank())\ngg <- gg + theme(axis.ticks.length=unit(5, \"pt\"))\n# breathing room for the plot\ngg <- gg + theme(plot.margin=unit(rep(0.5, 4), \"cm\"))\n# move the y-axis tick labels over a bit\ngg <- gg + theme(axis.text.y=element_text(margin=margin(r=-5)))\n# make the plot title bold and modify the bottom margin a bit\ngg <- gg + theme(plot.title=element_text(family=\"OpenSans-CondensedBold\", margin=margin(b=15)))\n# make the subtitle italic \ngg <- gg + theme(plot.subtitle=element_text(family=\"OpenSans-CondensedLightItalic\"))\n# make the caption smaller, left-justified and give it some room from the main part of the panel\ngg <- gg + theme(plot.caption=element_text(size=8, hjust=0, margin=margin(t=15)))\ngg\n<\/code><\/pre>\n<p>That generates:<\/p>\n<p><center><img decoding=\"async\" src=\"\/dl\/supremes.png\" width=\"75%\"\/><\/center><\/p>\n<p>All the annotations go with the code. No more tricks, hacks or desperate calls for help on StackOverflow!<\/p>\n<p>Now, this <em>does<\/em> add two new elements to the underlying <code>gtable<\/code> that gets built, so some <em>other<\/em> StackOverflow (et al) hacks may break if they don't use names (these elements are named in the <code>gtable<\/code> just like their ggplot2 names). We didn't muck with the widths\/columns at all, so all those hacks (mostly for multi-plot alignment) should still work.<\/p>\n<p>All the code\/data is (again) in <a href=\"https:\/\/gist.github.com\/hrbrmstr\/283850725519e502e70c\">this gist<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a follow up to a twitter-gist post &amp; to the annotation party we&#8217;re having this week I had not intended this to be &#8220;Annotation Week&#8221; but there was a large, positive response to my annotation &#8220;hack&#8221; post. This reaction surprised me, then someone pointed me to this link and also noted that if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4143,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[24,678,764,673,674,753,91],"tags":[810],"class_list":["post-4133","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-charts-graphs","category-data-visualization","category-data-wrangling","category-datavis-2","category-dataviz","category-ggplot","category-r","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Supreme Annotations - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Supreme Annotations - rud.is\" \/>\n<meta property=\"og:description\" content=\"This is a follow up to a twitter-gist post &amp; to the annotation party we&#8217;re having this week I had not intended this to be &#8220;Annotation Week&#8221; but there was a large, positive response to my annotation &#8220;hack&#8221; post. This reaction surprised me, then someone pointed me to this link and also noted that if [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-16T12:47:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-06-26T17:52:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1266\" \/>\n\t<meta property=\"og:image:height\" content=\"1041\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Supreme Annotations\",\"datePublished\":\"2016-03-16T12:47:02+00:00\",\"dateModified\":\"2018-06-26T17:52:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/\"},\"wordCount\":645,\"commentCount\":25,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/supremes.png?fit=1266%2C1041&ssl=1\",\"keywords\":[\"post\"],\"articleSection\":[\"Charts &amp; Graphs\",\"Data Visualization\",\"data wrangling\",\"DataVis\",\"DataViz\",\"ggplot\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/\",\"name\":\"Supreme Annotations - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/supremes.png?fit=1266%2C1041&ssl=1\",\"datePublished\":\"2016-03-16T12:47:02+00:00\",\"dateModified\":\"2018-06-26T17:52:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/supremes.png?fit=1266%2C1041&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/supremes.png?fit=1266%2C1041&ssl=1\",\"width\":1266,\"height\":1041},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2016\\\/03\\\/16\\\/supreme-annotations\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Supreme Annotations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Supreme Annotations - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/","og_locale":"en_US","og_type":"article","og_title":"Supreme Annotations - rud.is","og_description":"This is a follow up to a twitter-gist post &amp; to the annotation party we&#8217;re having this week I had not intended this to be &#8220;Annotation Week&#8221; but there was a large, positive response to my annotation &#8220;hack&#8221; post. This reaction surprised me, then someone pointed me to this link and also noted that if [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/","og_site_name":"rud.is","article_published_time":"2016-03-16T12:47:02+00:00","article_modified_time":"2018-06-26T17:52:43+00:00","og_image":[{"width":1266,"height":1041,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Supreme Annotations","datePublished":"2016-03-16T12:47:02+00:00","dateModified":"2018-06-26T17:52:43+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/"},"wordCount":645,"commentCount":25,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1","keywords":["post"],"articleSection":["Charts &amp; Graphs","Data Visualization","data wrangling","DataVis","DataViz","ggplot","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/","url":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/","name":"Supreme Annotations - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1","datePublished":"2016-03-16T12:47:02+00:00","dateModified":"2018-06-26T17:52:43+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1","width":1266,"height":1041},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Supreme Annotations"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1266%2C1041&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-14F","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":14001,"url":"https:\/\/rud.is\/b\/2023\/04\/29\/supreme-annotations-plot-redux-an-ojs-plot%e2%86%94ggplot2-rosetta-stone\/","url_meta":{"origin":4133,"position":0},"title":"Supreme Annotations Plot Redux &#038; An OJS Plot\u2194ggplot2 Rosetta Stone","author":"hrbrmstr","date":"2023-04-29","format":false,"excerpt":"Back in 2016, I did a post on {ggplot2} text annotations because it was a tad more challenging to do some of the things in that post back in the day. Since I've been moving back and forth between R and Observable (and JavaScript in general), I decided to recreate\u2026","rel":"","context":"In &quot;Observable&quot;","block_context":{"text":"Observable","link":"https:\/\/rud.is\/b\/category\/observable\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4087,"url":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/","url_meta":{"origin":4133,"position":1},"title":"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2]","author":"hrbrmstr","date":"2016-03-12","format":false,"excerpt":"UPDATE: A newer blog post explaining the new ggplot2 additions: http:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/ UPDATE: this capability (+ more) are being rolled into ggplot2-proper. PR will be absorbed into ggplot2 main branch soon. exciting, annotated times ahead! UPDATE: fontsize issue has been fixed & there's a Shiny gadget available for interactively making subtitles.\u2026","rel":"","context":"In &quot;DataVis&quot;","block_context":{"text":"DataVis","link":"https:\/\/rud.is\/b\/category\/datavis-2\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=1043%2C782&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=1043%2C782&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=1043%2C782&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=1043%2C782&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1890,"url":"https:\/\/rud.is\/b\/2013\/01\/12\/how-low-can-it-the-mississsippi-river-go\/","url_meta":{"origin":4133,"position":2},"title":"How Low Can It [The Mississsippi River] Go?","author":"hrbrmstr","date":"2013-01-12","format":false,"excerpt":"Good Stats, Bad Stats has a really good critique of this post that you should read after this (so you know how to avoid the mistakes I made :-) I've heard quite a bit about the current problems with the Mississippi River and wanted to see for myself (with data)\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5050,"url":"https:\/\/rud.is\/b\/2017\/02\/15\/ggalt-0-4-0-now-on-cran\/","url_meta":{"origin":4133,"position":3},"title":"ggalt 0.4.0 now on CRAN","author":"hrbrmstr","date":"2017-02-15","format":false,"excerpt":"I'm uncontainably excited to report that the ggplot2 extension package ggalt is now on CRAN. The absolute best part of this package is the R community members who contributed suggestions and new geoms, stats, annotations and integration features. This release would not be possible without the PRs from: Ben Bolker\u2026","rel":"","context":"In &quot;ggplot&quot;","block_context":{"text":"ggplot","link":"https:\/\/rud.is\/b\/category\/ggplot\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/02\/RStudio-1.png?fit=1200%2C510&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/02\/RStudio-1.png?fit=1200%2C510&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/02\/RStudio-1.png?fit=1200%2C510&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/02\/RStudio-1.png?fit=1200%2C510&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/02\/RStudio-1.png?fit=1200%2C510&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3827,"url":"https:\/\/rud.is\/b\/2015\/12\/21\/update-to-metricsgraphics-0-9-0-now-on-cran\/","url_meta":{"origin":4133,"position":4},"title":"Update to metricsgraphics 0.9.0 (now on CRAN)","author":"hrbrmstr","date":"2015-12-21","format":false,"excerpt":"It's been a while since I've updated my [metricsgraphics package](https:\/\/cran.r-project.org\/web\/packages\/metricsgraphics\/index.html). The hit list for changes includes: - Fixes for the new ggplot2 release (metricsgraphics uses the `movies` data set which is now in ggplot2movies) - Updated all javascript libraries to the most recent versions - Borrowed the ability to add\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/Google-ChromeScreenSnapz001.png?fit=813%2C539&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/Google-ChromeScreenSnapz001.png?fit=813%2C539&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/Google-ChromeScreenSnapz001.png?fit=813%2C539&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/Google-ChromeScreenSnapz001.png?fit=813%2C539&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":13382,"url":"https:\/\/rud.is\/b\/2022\/04\/03\/turning-ggplot2-into-a-pos-point-of-sale-system\/","url_meta":{"origin":4133,"position":5},"title":"Turning {ggplot2} Into a PoS (Point-of-Sale) System","author":"hrbrmstr","date":"2022-04-03","format":false,"excerpt":"At the end of March, I caught a fleeting tweet that showcased an Epson thermal receipt printer generating a new \"ticket\" whenever a new GitHub issue was filed on a repository. @aschmelyun documents it well in this blog post. It's a pretty cool hack, self-contained on a Pi Zero. Andrew's\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/04\/FPR9RFaXwAgE6bN-scaled.jpeg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/04\/FPR9RFaXwAgE6bN-scaled.jpeg?resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/04\/FPR9RFaXwAgE6bN-scaled.jpeg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/04\/FPR9RFaXwAgE6bN-scaled.jpeg?resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/04\/FPR9RFaXwAgE6bN-scaled.jpeg?resize=1050%2C600 3x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/04\/FPR9RFaXwAgE6bN-scaled.jpeg?resize=1400%2C800 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=4133"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4133\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/4143"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=4133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=4133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=4133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}