

{"id":4087,"date":"2016-03-12T16:09:47","date_gmt":"2016-03-12T21:09:47","guid":{"rendered":"http:\/\/rud.is\/b\/?p=4087"},"modified":"2018-03-10T07:55:22","modified_gmt":"2018-03-10T12:55:22","slug":"ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/","title":{"rendered":"ggplot2\u3067\u5b57\u5e55 <br\/>[Subtitles in ggplot2]"},"content":{"rendered":"<blockquote><p>\n  UPDATE: A newer blog post explaining the new ggplot2 additions: <a href=\"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/\">http:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/<\/a><\/p>\n<p>  UPDATE: this capability (+ more) are being rolled into ggplot2-proper. PR will be absorbed into ggplot2 main branch soon. exciting, annotated times ahead!<\/p>\n<p>  UPDATE: <code>fontsize<\/code> issue has been fixed &amp; there&#8217;s a Shiny gadget available for interactively making subtitles. More info at the end of the post.\n<\/p><\/blockquote>\n<p>Subtitles aren&#8217;t always necessary for plots, but I began to use them enough that I whipped up a function for <code>ggplot2<\/code> that does a decent job adding a subtitle to a finished plot object. More than a few folks have tried their hand at this in the past and this is just my incremental contribution until there&#8217;s proper support in <code>ggplot2<\/code> (someone&#8217;s <em>bound<\/em> to add it via PR at some point).<\/p>\n<p>We&#8217;ll nigh fully recreate the following plot from <span class=\"removed_link\" title=\"https:\/\/www.washingtonpost.com\/news\/wonk\/wp\/2016\/01\/19\/how-the-most-disliked-and-elected-profession-is-disappearing-from-politics\/\">this WaPo article<\/span>:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/2300lawyers0116-2.jpg?ssl=1\" rel=\"attachment wp-att-4088\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4088\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/2300lawyers0116-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/2300lawyers0116-2.jpg?fit=2300%2C1553&amp;ssl=1\" data-orig-size=\"2300,1553\" 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=\"2300lawyers0116-2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/2300lawyers0116-2.jpg?fit=300%2C203&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/2300lawyers0116-2.jpg?fit=510%2C344&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/2300lawyers0116-2.jpg?resize=460%2C310&#038;ssl=1\" alt=\"2300lawyers0116-2\" width=\"460\" height=\"310\" class=\"aligncenter size-full wp-image-4088\" \/><\/a><\/p>\n<p>Here&#8217;s a stab at that w\/o the subtitle:<\/p>\n<pre lang=\"rsplus\">library(ggplot2)\nlibrary(scales)\n\ndata.frame(\n  yrs=c(\"1789-90\", \"1849-50\", \"1909-10\", \"1965-66\", \"2016-16\"),\n  pct=c(0.526, 0.795, 0.713, 0.575, 0.365),\n  xtralabs=c(\"\", \"Highest:\\n\", \"\", \"\", \"Lowest:\\n\")\n) -> hill_lawyers\n\ngg <- ggplot(hill_lawyers, aes(yrs, pct))\ngg <- gg + geom_bar(stat=\"identity\", width=0.65)\ngg <- gg + geom_label(aes(label=sprintf(\"%s%s\", xtralabs, percent(pct))),\n                      vjust=-0.4, family=c(rep(\"FranklinGothic-Book\", 4),\"FranklinGothic-Heavy\"), \n                      lineheight=0.9, size=4, label.size=0)\ngg <- gg + scale_x_discrete()\ngg <- gg + scale_y_continuous(expand=c(0,0), limits=c(0.0, 1.0), labels=percent)\ngg <- gg + labs(x=NULL, y=NULL, title=\"Fewer and fewer lawyers on the Hill\")\ngg <- gg + theme_minimal(base_family=\"FranklinGothic-Book\")\ngg <- gg + theme(axis.line=element_line(color=\"#2b2b2b\", size=0.5))\ngg <- gg + theme(axis.line.y=element_blank())\ngg <- gg + theme(axis.text.x=element_text(family=c(rep(\"FranklinGothic-Book\", 4),\n                                                   \"FranklinGothic-Heavy\")))\ngg <- gg + theme(panel.grid.major.x=element_blank())\ngg <- gg + theme(panel.grid.major.y=element_line(color=\"#b2b2b2\", size=0.1))\ngg <- gg + theme(panel.grid.minor.y=element_blank())\ngg <- gg + theme(plot.title=element_text(hjust=0, \n                                         family=\"FranklinGothic-Heavy\", \n                                         margin=margin(b=10)))\ngg<\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudio.png?ssl=1\" rel=\"attachment wp-att-4091\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4091\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/rstudio-7\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudio.png?fit=1098%2C704&amp;ssl=1\" data-orig-size=\"1098,704\" 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=\"RStudio\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudio.png?fit=300%2C192&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudio.png?fit=510%2C327&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/RStudio.png?w=510&#038;ssl=1\" alt=\"RStudio\"   class=\"aligncenter size-full wp-image-4091\" \/><\/a><\/p>\n<blockquote><p>\n  (There are some \"tricks\" in that plotting code that may be worth spending an extra minute or two to mull over if you didn't realize some of the function parameters were vectorized, or that you could get a white background with no border for text labels so grid lines don't get in the way.)\n<\/p><\/blockquote>\n<p>Ideally, a subtitle would be part of the <code>gtable<\/code> that gets made underneath the covers so it will \"travel well\" with the plot object itself. The function below makes a <code>textGrob<\/code> from whatever text we pass into it and does just that; it inserts the new grob into a new table row.<\/p>\n<pre lang=\"rsplus\">#' Add a subtitle to a ggplot object and draw plot on current graphics device.\n#' \n#' @param gg ggplot2 object\n#' @param label subtitle label\n#' @param fontfamily font family to use. The function doesn't pull any font \n#'        information from \\code{gg} so you should consider specifying fonts\n#'        for the plot itself and here. Or send me code to make this smarter :-)\n#' @param fontsize font size\n#' @param hjust,vjust horizontal\/vertical justification \n#' @param bottom_margin space between bottom of subtitle and plot (code{pts})\n#' @param newpage draw new (empty) page first?\n#' @param vp viewport to draw plot in\n#' @param ... parameters passed to \\code{gpar} in call to \\code{textGrob}\n#' @return Invisibly returns the result of \\code{\\link{ggplot_build}}, which\n#'   is a list with components that contain the plot itself, the data,\n#'   information about the scales, panels etc.\nggplot_with_subtitle <- function(gg, \n                                 label=\"\", \n                                 fontfamily=NULL,\n                                 fontsize=10,\n                                 hjust=0, vjust=0, \n                                 bottom_margin=5.5,\n                                 newpage=is.null(vp),\n                                 vp=NULL,\n                                 ...) {\n  \n  if (is.null(fontfamily)) {\n    gpr <- gpar(fontsize=fontsize, ...)\n  } else {\n    gpr <- gpar(fontfamily=fontfamily, fontsize=fontsize, ...)\n  }\n  \n  subtitle <- textGrob(label, x=unit(hjust, \"npc\"), y=unit(hjust, \"npc\"), \n                       hjust=hjust, vjust=vjust,\n                       gp=gpr)\n  \n  data <- ggplot_build(gg)\n  \n  gt <- ggplot_gtable(data)\n  gt <- gtable_add_rows(gt, grobHeight(subtitle), 2)\n  gt <- gtable_add_grob(gt, subtitle, 3, 4, 3, 4, 8, \"off\", \"subtitle\")\n  gt <- gtable_add_rows(gt, grid::unit(bottom_margin, \"pt\"), 3)\n  \n  if (newpage) grid.newpage()\n  \n  if (is.null(vp)) {\n    grid.draw(gt)\n  } else {\n    if (is.character(vp)) seekViewport(vp) else pushViewport(vp)\n    grid.draw(gt)\n    upViewport()\n  }\n  \n  invisible(data)\n  \n}<\/pre>\n<p>The roxygen comments should give you an idea of how to work with it, and here it is in action:<\/p>\n<pre lang=\"rsplus\">subtitle <- \"The percentage of Congressional members that are laywers has been\\ncontinuously dropping since the 1960s\"\n\nggplot_with_subtitle(gg, subtitle,\n                     fontfamily=\"FranklinGothic-Book\",\n                     bottom_margin=20, lineheight=0.9)<\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__3_39_PM.png?ssl=1\" rel=\"attachment wp-att-4095\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4095\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/fullscreen_3_12_16__3_39_pm\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__3_39_PM.png?fit=1097%2C705&amp;ssl=1\" data-orig-size=\"1097,705\" 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=\"Fullscreen_3_12_16__3_39_PM\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__3_39_PM.png?fit=300%2C193&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__3_39_PM.png?fit=510%2C328&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__3_39_PM.png?w=510&#038;ssl=1\" alt=\"Fullscreen_3_12_16__3_39_PM\"  class=\"aligncenter size-full wp-image-4095\" \/><\/a><\/p>\n<p>It deals with long annotations pretty well, too (I <code>strwrap<\/code>ped the source text for the below at <code>100<\/code> characters). The text is senseless here, but it's just for show (I had it handy\u2026don't judge\u2026you're getting free code :-):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?ssl=1\" rel=\"attachment wp-att-4112\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4112\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/fullscreen_3_12_16__7_44_pm\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=1043%2C782&amp;ssl=1\" data-orig-size=\"1043,782\" 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=\"Fullscreen_3_12_16__7_44_PM\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=300%2C225&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?fit=510%2C382&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Fullscreen_3_12_16__7_44_PM.png?w=510&#038;ssl=1\" alt=\"Fullscreen_3_12_16__7_44_PM\"  class=\"aligncenter size-full wp-image-4112\" \/><\/a><\/p>\n<p>I think this beats manually re-creating the wheel, even if you only infrequently use subtitles. It definitely beats hand-editing plots and is a bit more elegant and functional than using <code>grid.arrange<\/code> (et al) to mimic the functionality. It also beats futzing with panel margins and clipping to shoehorn a frankenmashup mess of <code>geom_text<\/code> or <code>annotation_custom<\/code> calls.<\/p>\n<p>Kick the tyres, tell me where it breaks and if I can cover enough edge cases (or make it smarter) I'll add it to my <code>ggalt<\/code> package.<\/p>\n<h3>Shiny Subtitle Gadget<\/h3>\n<p>Thanks to:<\/p>\n<blockquote class=\"twitter-tweet\" data-lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/mobile.twitter.com\/hrbrmstr\">@hrbrmstr<\/a> Sweet. Any thoughts of making it an RStudio addin?<\/p>\n<p>&mdash; Andrew Clark (@pssGuy) <a href=\"https:\/\/mobile.twitter.com\/pssGuy\/status\/708831002034987008\">March 13, 2016<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>you can now play with an experimental Shiny gadget which you can load by <code>devtools::install_github(\"hrbrmstr\/hrbrmisc\")<\/code> (that's a temporary home for it, I use this pkg for testing\/playing). Just select a <code>ggplot2<\/code> object variable name in RStudio and then select <em>\"Add subtitle\"<\/em> from the <em>Addins<\/em> menu and give it a whirl. It looks like this:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Development_hrbrmisc_-_master_-_RStudio.png?ssl=1\" rel=\"attachment wp-att-4116\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4116\" data-permalink=\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/__development_hrbrmisc_-_master_-_rstudio\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Development_hrbrmisc_-_master_-_RStudio.png?fit=1162%2C1318&amp;ssl=1\" data-orig-size=\"1162,1318\" 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=\"__Development_hrbrmisc_-_master_-_RStudio\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Development_hrbrmisc_-_master_-_RStudio.png?fit=264%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Development_hrbrmisc_-_master_-_RStudio.png?fit=510%2C578&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/Development_hrbrmisc_-_master_-_RStudio.png?w=510&#038;ssl=1\" alt=\"__Development_hrbrmisc_-_master_-_RStudio\"  class=\"aligncenter size-full wp-image-4116\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &amp; there&#8217;s a Shiny gadget available for interactively making subtitles. More info at the end [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4112,"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":true,"_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":[673,674,753,91],"tags":[810],"class_list":["post-4087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-datavis-2","category-dataviz","category-ggplot","category-r","tag-post"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2] - 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\/12\/ggplot2\u3067\u5b57\u5e55-subtitles-in-ggplot2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2] - rud.is\" \/>\n<meta property=\"og:description\" content=\"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 &amp; there&#8217;s a Shiny gadget available for interactively making subtitles. More info at the end [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2\u3067\u5b57\u5e55-subtitles-in-ggplot2\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-12T21:09:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-10T12:55:22+00:00\" \/>\n<meta property=\"og:image\" content=\"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\" \/>\n\t<meta property=\"og:image:width\" content=\"1043\" \/>\n\t<meta property=\"og:image:height\" content=\"782\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2]\",\"datePublished\":\"2016-03-12T21:09:47+00:00\",\"dateModified\":\"2018-03-10T12:55:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/\"},\"wordCount\":482,\"commentCount\":12,\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage\"},\"thumbnailUrl\":\"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\",\"keywords\":[\"post\"],\"articleSection\":[\"DataVis\",\"DataViz\",\"ggplot\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/\",\"url\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/\",\"name\":\"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2] - rud.is\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage\"},\"thumbnailUrl\":\"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\",\"datePublished\":\"2016-03-12T21:09:47+00:00\",\"dateModified\":\"2018-03-10T12:55:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage\",\"url\":\"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\",\"contentUrl\":\"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\",\"width\":1043,\"height\":782},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rud.is\/b\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2]\"}]},{\"@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":"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2] - 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\/12\/ggplot2\u3067\u5b57\u5e55-subtitles-in-ggplot2\/","og_locale":"en_US","og_type":"article","og_title":"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2] - rud.is","og_description":"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 &amp; there&#8217;s a Shiny gadget available for interactively making subtitles. More info at the end [&hellip;]","og_url":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2\u3067\u5b57\u5e55-subtitles-in-ggplot2\/","og_site_name":"rud.is","article_published_time":"2016-03-12T21:09:47+00:00","article_modified_time":"2018-03-10T12:55:22+00:00","og_image":[{"width":1043,"height":782,"url":"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","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2]","datePublished":"2016-03-12T21:09:47+00:00","dateModified":"2018-03-10T12:55:22+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/"},"wordCount":482,"commentCount":12,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage"},"thumbnailUrl":"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","keywords":["post"],"articleSection":["DataVis","DataViz","ggplot","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/","url":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/","name":"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2] - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage"},"thumbnailUrl":"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","datePublished":"2016-03-12T21:09:47+00:00","dateModified":"2018-03-10T12:55:22+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#primaryimage","url":"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","contentUrl":"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","width":1043,"height":782},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2016\/03\/12\/ggplot2%e3%81%a7%e5%ad%97%e5%b9%95-subtitles-in-ggplot2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"ggplot2\u3067\u5b57\u5e55 [Subtitles in ggplot2]"}]},{"@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\/Fullscreen_3_12_16__7_44_PM.png?fit=1043%2C782&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-13V","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":4133,"url":"https:\/\/rud.is\/b\/2016\/03\/16\/supreme-annotations\/","url_meta":{"origin":4087,"position":0},"title":"Supreme Annotations","author":"hrbrmstr","date":"2016-03-16","format":false,"excerpt":"This is a follow up to a twitter-gist post & to the annotation party we're having this week I had not intended this to be \"Annotation Week\" but there was a large, positive response to my annotation \"hack\" post. This reaction surprised me, then someone pointed me to this link\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\/2016\/03\/supremes.png?fit=1200%2C987&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1200%2C987&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1200%2C987&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1200%2C987&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/03\/supremes.png?fit=1200%2C987&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3832,"url":"https:\/\/rud.is\/b\/2015\/12\/28\/world-map-panel-plots-with-ggplot2-2-0-ggalt\/","url_meta":{"origin":4087,"position":1},"title":"World Map Panel Plots with ggplot2 2.0 &#038; ggalt","author":"hrbrmstr","date":"2015-12-28","format":false,"excerpt":"James Austin (@awhstin) made some #spiffy 4-panel maps with base R graphics but also posited he didn't use ggplot2 because: \u2026ggplot2 and maps currently do not support world maps at this point, which does not give us a great overall view. That is certainly a box I would not put\u2026","rel":"","context":"In &quot;cartography&quot;","block_context":{"text":"cartography","link":"https:\/\/rud.is\/b\/category\/cartography\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/12\/facetmaps.png?fit=1154%2C722&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3665,"url":"https:\/\/rud.is\/b\/2015\/09\/08\/roll-your-own-stats-and-geoms-in-ggplot2-part-1-splines\/","url_meta":{"origin":4087,"position":2},"title":"Roll Your Own Stats and Geoms in ggplot2 (Part 1: Splines!)","author":"hrbrmstr","date":"2015-09-08","format":false,"excerpt":"A huge change is coming to ggplot2 and you can get a preview of it over at Hadley's github repo. I've been keenly interested in this as I will be fixing, finishing & porting coord_proj to it once it's done. Hadley & Winston have re-built ggplot2 with an entirely new\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"https:\/\/rud.is\/b\/category\/data-visualization\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12354,"url":"https:\/\/rud.is\/b\/2019\/06\/18\/quick-hit-some-ggplot2-stat\/","url_meta":{"origin":4087,"position":3},"title":"Quick hit: Some ggplot2 Stat ? for {logspline}","author":"hrbrmstr","date":"2019-06-18","format":false,"excerpt":"I've become a big fan of the {logspline} package over the past ~6 months and decided to wrap up a manual ggplot2 plotting process (well, it was at least in an RStudio snippet) into a small {ggplot2} Stat to make it easier to visualize various components of the fitted model.\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\/2019\/06\/logspline-ex-01.png?fit=1200%2C1069&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/logspline-ex-01.png?fit=1200%2C1069&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/logspline-ex-01.png?fit=1200%2C1069&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/logspline-ex-01.png?fit=1200%2C1069&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/logspline-ex-01.png?fit=1200%2C1069&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3929,"url":"https:\/\/rud.is\/b\/2016\/02\/11\/plot-the-new-svg-r-logo-with-ggplot2\/","url_meta":{"origin":4087,"position":4},"title":"Plot the new SVG R logo with ggplot2","author":"hrbrmstr","date":"2016-02-11","format":false,"excerpt":"High resolution and SVG versions of the new R logo are finally available. I converted the SVG to WKT (file here) which means we can use it like we would a shapefile in R. That includes plotting! Here's a short example of how to read that WKT and plot the\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\/2016\/02\/RStudio.png?fit=1198%2C942&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/RStudio.png?fit=1198%2C942&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/RStudio.png?fit=1198%2C942&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/RStudio.png?fit=1198%2C942&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2016\/02\/RStudio.png?fit=1198%2C942&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"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":4087,"position":5},"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":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4087","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=4087"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/4087\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/4112"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=4087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=4087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=4087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}