

{"id":12282,"date":"2019-06-06T09:16:22","date_gmt":"2019-06-06T14:16:22","guid":{"rendered":"https:\/\/rud.is\/b\/?p=12282"},"modified":"2019-06-06T09:16:22","modified_gmt":"2019-06-06T14:16:22","slug":"make-multi-point-dumbbell-plots-in-ggplot2","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/","title":{"rendered":"Make Multi-point &#8220;dumbbell&#8221; Plots in ggplot2"},"content":{"rendered":"<p>A user of the <a href=\"https:\/\/github.com\/hrbrmstr\/ggalt\/\"><code>{ggalt}<\/code> package<\/a> recently <a href=\"https:\/\/github.com\/hrbrmstr\/ggalt\/issues\/59\">posted a question<\/a> about how to add points to a <code>geom_dumbbell()<\/code> plot. For now, this is not something you can do with <code>geom_dumbbell()<\/code> but with a bit of data wrangling you can do this in a pretty straightforward manner with just your data and ggplot2. The example below uses 3 values per category but it should scale to <code>n<\/code> values per category (though after a certain <code>n<\/code> you should reconsider the use of a dummbell chart in favour of a more appropriate way to visualize the message you&#8217;re trying to convey).<\/p>\n<p>Here&#8217;s the setup:<\/p>\n<pre><code class=\"language-r\">library(hrbrthemes)\nlibrary(tidyverse)\n\ntibble(\n  val1 = c(3, 2, 4),\n  val2 = c(1, 4, 5),\n  val3 = c(5, 8, 6),\n  cat = factor(month.name[1:3], levels = rev(month.name[1:3]))\n) -&gt; xdf\n<\/code><\/pre>\n<p>Three values per category. The approach is pretty straightforward:<\/p>\n<ul>\n<li>reshape the data frame &amp; get min value so you can draw an eye-tracking line (this is one geom)<\/li>\n<li>reshape the data frame &amp; get min\/max category values so you can draw the segment (this is another geom)<\/li>\n<li>reshape the data frame &amp; plot the points<\/li>\n<\/ul>\n<p>I&#8217;ve put ^^ notes near each ggplot2 geom:<\/p>\n<pre><code class=\"language-r\">ggplot() +\n  # reshape the data frame &amp; get min value so you can draw an eye-tracking line (this is one geom)\n  geom_segment(\n    data = gather(xdf, measure, val, -cat) %&gt;% \n      group_by(cat) %&gt;% \n      top_n(-1) %&gt;% \n      slice(1) %&gt;%\n      ungroup(),\n    aes(x = 0, xend = val, y = cat, yend = cat),\n    linetype = \"dotted\", size = 0.5, color = \"gray80\"\n  ) +\n  # reshape the data frame &amp; get min\/max category values so you can draw the segment (this is another geom)\n  geom_segment(\n    data = gather(xdf, measure, val, -cat) %&gt;% \n      group_by(cat) %&gt;% \n      summarise(start = range(val)[1], end = range(val)[2]) %&gt;% \n      ungroup(),\n    aes(x = start, xend = end, y = cat, yend = cat),\n    color = \"gray80\", size = 2\n  ) +\n  # reshape the data frame &amp; plot the points\n  geom_point(\n    data = gather(xdf, measure, value, -cat),\n    aes(value, cat, color = measure), \n    size = 4\n  ) +\n  # i just extended the scale a bit + put axis on top; choose aesthetics that work \n  # for you\n  scale_x_comma(position = \"top\", limits = c(0, 10)) +\n  scale_color_ipsum(name = \"A real legend title\") +\n  labs(\n    x = \"Description of the value\", y = NULL,\n    title = \"A good plot title\"\n  ) +\n  theme_ipsum_rc(grid = \"X\") +\n  theme(legend.position = \"top\")\n<\/code><\/pre>\n<p>And, here&#8217;s the result:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12284\" data-permalink=\"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/there-are-three-points-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&amp;ssl=1\" data-orig-size=\"1444,674\" 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=\"there-are-three-points-2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=510%2C238&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=510%2C238&#038;ssl=1\" alt=\"\" width=\"510\" height=\"238\" class=\"aligncenter size-large wp-image-12284\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=530%2C247&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=150%2C70&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=300%2C140&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=768%2C358&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=500%2C233&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=1200%2C560&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=400%2C187&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=800%2C373&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?resize=200%2C93&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?w=1444&amp;ssl=1 1444w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A user of the {ggalt} package recently posted a question about how to add points to a geom_dumbbell() plot. For now, this is not something you can do with geom_dumbbell() but with a bit of data wrangling you can do this in a pretty straightforward manner with just your data and ggplot2. The example below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12284,"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":[753,91],"tags":[],"class_list":["post-12282","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ggplot","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Make Multi-point &quot;dumbbell&quot; Plots 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\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Make Multi-point &quot;dumbbell&quot; Plots in ggplot2 - rud.is\" \/>\n<meta property=\"og:description\" content=\"A user of the {ggalt} package recently posted a question about how to add points to a geom_dumbbell() plot. For now, this is not something you can do with geom_dumbbell() but with a bit of data wrangling you can do this in a pretty straightforward manner with just your data and ggplot2. The example below [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-06T14:16:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1444\" \/>\n\t<meta property=\"og:image:height\" content=\"674\" \/>\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\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Make Multi-point &#8220;dumbbell&#8221; Plots in ggplot2\",\"datePublished\":\"2019-06-06T14:16:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/\"},\"wordCount\":172,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/there-are-three-points-2.png?fit=1444%2C674&ssl=1\",\"articleSection\":[\"ggplot\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/\",\"name\":\"Make Multi-point \\\"dumbbell\\\" Plots in ggplot2 - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/there-are-three-points-2.png?fit=1444%2C674&ssl=1\",\"datePublished\":\"2019-06-06T14:16:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/there-are-three-points-2.png?fit=1444%2C674&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/there-are-three-points-2.png?fit=1444%2C674&ssl=1\",\"width\":1444,\"height\":674},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/06\\\/06\\\/make-multi-point-dumbbell-plots-in-ggplot2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Make Multi-point &#8220;dumbbell&#8221; Plots 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":"Make Multi-point \"dumbbell\" Plots 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\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/","og_locale":"en_US","og_type":"article","og_title":"Make Multi-point \"dumbbell\" Plots in ggplot2 - rud.is","og_description":"A user of the {ggalt} package recently posted a question about how to add points to a geom_dumbbell() plot. For now, this is not something you can do with geom_dumbbell() but with a bit of data wrangling you can do this in a pretty straightforward manner with just your data and ggplot2. The example below [&hellip;]","og_url":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/","og_site_name":"rud.is","article_published_time":"2019-06-06T14:16:22+00:00","og_image":[{"width":1444,"height":674,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&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\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Make Multi-point &#8220;dumbbell&#8221; Plots in ggplot2","datePublished":"2019-06-06T14:16:22+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/"},"wordCount":172,"commentCount":7,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&ssl=1","articleSection":["ggplot","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/","url":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/","name":"Make Multi-point \"dumbbell\" Plots in ggplot2 - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&ssl=1","datePublished":"2019-06-06T14:16:22+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&ssl=1","width":1444,"height":674},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2019\/06\/06\/make-multi-point-dumbbell-plots-in-ggplot2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Make Multi-point &#8220;dumbbell&#8221; Plots 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\/2019\/06\/there-are-three-points-2.png?fit=1444%2C674&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-3c6","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3442,"url":"https:\/\/rud.is\/b\/2015\/05\/26\/a-quick-incomplete-comparison-of-ggplot2-rbokeh-plotting-idioms\/","url_meta":{"origin":12282,"position":0},"title":"A quick, incomplete comparison of ggplot2 &#038; rbokeh plotting idioms","author":"hrbrmstr","date":"2015-05-26","format":false,"excerpt":"I set aside a small bit of time to give [rbokeh](https:\/\/github.com\/bokeh\/rbokeh) a try and figured I'd share a small bit of code that shows how to make the \"same\" chart in both ggplot2 and rbokeh. #### What is Bokeh\/rbokeh? rbokeh is an [htmlwidget](http:\/\/htmlwidgets.org) wrapper for the [Bokeh](http:\/\/bokeh.pydata.org\/en\/latest\/) visualization library that\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":12388,"url":"https:\/\/rud.is\/b\/2019\/06\/30\/make-refreshing-segmented-column-charts-with-ggchicklet\/","url_meta":{"origin":12282,"position":1},"title":"Make Refreshing Segmented Column Charts with {ggchicklet}","author":"hrbrmstr","date":"2019-06-30","format":false,"excerpt":"The first U.S. Democratic debates of the 2020 election season were held over two nights this past week due to the daft number of candidates running for POTUS. The spiffy @NYTgraphics folks took the tallies of time spent blathering by each speaker\/topic and made rounded rectangle segmented bar charts ordered\u2026","rel":"","context":"In &quot;ggplot&quot;","block_context":{"text":"ggplot","link":"https:\/\/rud.is\/b\/category\/ggplot\/"},"img":{"alt_text":"final chicklet chart","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/chicklet-07-1.png?fit=1200%2C960&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/chicklet-07-1.png?fit=1200%2C960&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/chicklet-07-1.png?fit=1200%2C960&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/chicklet-07-1.png?fit=1200%2C960&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/06\/chicklet-07-1.png?fit=1200%2C960&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3278,"url":"https:\/\/rud.is\/b\/2015\/02\/15\/introducing-the-streamgraph-htmlwidget-r-pacakge\/","url_meta":{"origin":12282,"position":2},"title":"Introducing the streamgraph htmlwidget R Package","author":"hrbrmstr","date":"2015-02-15","format":false,"excerpt":"We were looking for a different type of visualization for a project at work this past week and my thoughts immediately gravitated towards [streamgraphs](http:\/\/www.leebyron.com\/else\/streamgraph\/). The TLDR on streamgraphs is they they are generalized versions of stacked area graphs with free baselines across the x axis. They are somewhat [controversial](http:\/\/www.visualisingdata.com\/index.php\/2010\/08\/making-sense-of-streamgraphs\/) but\u2026","rel":"","context":"In &quot;d3&quot;","block_context":{"text":"d3","link":"https:\/\/rud.is\/b\/category\/d3\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13262,"url":"https:\/\/rud.is\/b\/2022\/01\/04\/starting-2022-off-with-a-fairly-complex-ggplot2-recreation-plot\/","url_meta":{"origin":12282,"position":3},"title":"Starting 2022 Off With A Fairly Complex {ggplot2} Recreation Plot","author":"hrbrmstr","date":"2022-01-04","format":false,"excerpt":"The New York Times had a [tragic] story on Covid deaths today and one of their plots really stuck with me for how well it told that part of the story. NOTE: The red panel highlights are off a bit as I manually typed the data in (I only did\u2026","rel":"","context":"In &quot;ggplot&quot;","block_context":{"text":"ggplot","link":"https:\/\/rud.is\/b\/category\/ggplot\/"},"img":{"alt_text":"{ggplot2} recreation of NYT plot","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/01\/2022-01-04-ggplot2.jpg?fit=929%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/01\/2022-01-04-ggplot2.jpg?fit=929%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/01\/2022-01-04-ggplot2.jpg?fit=929%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2022\/01\/2022-01-04-ggplot2.jpg?fit=929%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4027,"url":"https:\/\/rud.is\/b\/2016\/02\/28\/a-tale-of-two-charting-paradigms-vega-lite-vs-rggplot2\/","url_meta":{"origin":12282,"position":4},"title":"A Tale of Two Charting Paradigms: Vega-Lite vs R+ggplot2","author":"hrbrmstr","date":"2016-02-28","format":false,"excerpt":"This post comes hot off the heels of the [nigh-feature-complete release of `vegalite`](http:\/\/rud.is\/b\/2016\/02\/27\/create-vega-lite-specs-widgets-with-the-vegalite-package\/) (virtually all the components of Vega-Lite are now implemented and just need real-world user testing). I've had a few and seen a few questions about \"why Vega-Lite\"? I _think_ my previous post gave some good answers to\u2026","rel":"","context":"In &quot;d3&quot;","block_context":{"text":"d3","link":"https:\/\/rud.is\/b\/category\/d3\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12576,"url":"https:\/\/rud.is\/b\/2019\/12\/27\/short-attention-span-theatre-reproducing-axios-1-big-thing-google-trends-2019-news-in-review-with-ggplot2\/","url_meta":{"origin":12282,"position":5},"title":"Short Attention Span Theatre: Reproducing Axios&#8217; &#8220;1 Big Thing&#8221; Google Trends 2019 News In Review with {ggplot2}","author":"hrbrmstr","date":"2019-12-27","format":false,"excerpt":"I woke up to Axios' \"1 Big Thing\" ridgeline chart showing the crazy that was the 2019 news cycle: and, I decided to reproduce it in {ggplot2}. Getting The Data First, I had to find the data. The Axios chart is interactive, so I assumed the visualization was built on-load.\u2026","rel":"","context":"In &quot;ggplot&quot;","block_context":{"text":"ggplot","link":"https:\/\/rud.is\/b\/category\/ggplot\/"},"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\/12282","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=12282"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12282\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/12284"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=12282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=12282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=12282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}