{"id":16541,"date":"2020-05-28T12:08:19","date_gmt":"2020-05-28T11:08:19","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?p=16541"},"modified":"2020-05-28T12:08:19","modified_gmt":"2020-05-28T11:08:19","slug":"ggplot-how-to-display-the-last-value-of-each-line-as-label","status":"publish","type":"post","link":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/","title":{"rendered":"GGPLOT: How to Display the Last Value of Each Line as Label"},"content":{"rendered":"<div id=\"rdoc\">\n<p>This article describes how to <strong>display the last value of each line as a label<\/strong> using the ggplot2 R package. Different solutions are provided using either the <code>ggrepel<\/code> text labeling or the <code>ggplot2<\/code> secondary axis functions.<\/p>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n<li><a href=\"#using-ggrepel-to-add-labels-to-the-line-ends\">Using ggrepel to add labels to the line ends<\/a>\n<ul>\n<li><a href=\"#examples-for-discrete-x-axis\">Examples for discrete x-axis<\/a><\/li>\n<li><a href=\"#examples-for-time-series-data\">Examples for time series data<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#using-a-secondary-y-axis-to-show-the-line-labels\">Using a secondary y axis to show the line labels<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n<div id=\"prerequisites\" class=\"section level2\">\n<h2>Prerequisites<\/h2>\n<p>Required R packages:<\/p>\n<ul>\n<li><code>tidyverse<\/code>: easy data manipulation and visualization<\/li>\n<li><code>ggrepel<\/code>: provides <code>geoms<\/code> for ggplot2 to repel overlapping text labels: <code>geom_text_repel() and geom_label_repel()<\/code><\/li>\n<\/ul>\n<pre class=\"r\"><code># Load required R packages\r\nlibrary(tidyverse)\r\nlibrary(ggrepel)\r\n# Set ggplot2 default theme to theme_bw()\r\ntheme_set(theme_bw())\r\n\r\n# Demo data\r\ndf &lt;- tibble::tribble(\r\n      ~Species, ~Petal.Length, ~Petal.Width, ~Sepal.Length, ~Sepal.Width,\r\n      \"setosa\",         1.462,        0.246,         5.006,        3.428,\r\n  \"versicolor\",          4.26,        1.326,         5.936,         2.77,\r\n   \"virginica\",         5.552,        2.026,         6.588,        2.974\r\n  )\r\ndf<\/code><\/pre>\n<pre><code>## # A tibble: 3 x 5\r\n##   Species    Petal.Length Petal.Width Sepal.Length Sepal.Width\r\n##   &lt;chr&gt;             &lt;dbl&gt;       &lt;dbl&gt;        &lt;dbl&gt;       &lt;dbl&gt;\r\n## 1 setosa             1.46       0.246         5.01        3.43\r\n## 2 versicolor         4.26       1.33          5.94        2.77\r\n## 3 virginica          5.55       2.03          6.59        2.97<\/code><\/pre>\n<pre class=\"r\"><code># Transform the data into long format\r\n# Put Petal.Length to Sepal.Width in the same column\r\ndf_long &lt;- df %&gt;%\r\n  pivot_longer(\r\n    Petal.Length:Sepal.Width,\r\n    names_to = \"variable\", values_to = \"value\"\r\n  )\r\ndf_long<\/code><\/pre>\n<pre><code>## # A tibble: 12 x 3\r\n##   Species    variable     value\r\n##   &lt;chr&gt;      &lt;chr&gt;        &lt;dbl&gt;\r\n## 1 setosa     Petal.Length 1.46 \r\n## 2 setosa     Petal.Width  0.246\r\n## 3 setosa     Sepal.Length 5.01 \r\n## 4 setosa     Sepal.Width  3.43 \r\n## 5 versicolor Petal.Length 4.26 \r\n## 6 versicolor Petal.Width  1.33 \r\n## # \u2026 with 6 more rows<\/code><\/pre>\n<\/div>\n<div id=\"using-ggrepel-to-add-labels-to-the-line-ends\" class=\"section level2\">\n<h2>Using ggrepel to add labels to the line ends<\/h2>\n<div id=\"examples-for-discrete-x-axis\" class=\"section level3\">\n<h3>Examples for discrete x-axis<\/h3>\n<pre class=\"r\"><code># Basic line plot\r\nlp &lt;- ggplot(df_long, aes(x = Species, y = value, group = variable)) +\r\n  geom_line(aes(color = variable)) +\r\n  geom_point() +\r\n  theme(legend.position = \"top\")\r\n\r\n# Filter the last values and add onto the line plot\r\n# Corresponds to the `virginica` species\r\ndata_ends &lt;- df_long %&gt;% filter(Species == \"virginica\")\r\nlp + \r\n  geom_text_repel(\r\n    aes(label = value), data = data_ends,\r\n    fontface =\"plain\", color = \"black\", size = 3\r\n    )<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-tutorial\/figures\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\" width=\"576\" \/><\/p>\n<pre class=\"r\"><code># Use variable names as labels\r\nlp2 &lt;- ggplot(df_long, aes(x = Species, y = value, group = variable)) +\r\n  geom_line() +\r\n  geom_point() \r\nlp2 + \r\n  geom_text_repel(\r\n    aes(label = variable), data = data_ends,\r\n    color = \"black\", size = 3\r\n    )<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-tutorial\/figures\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-2.png\" width=\"576\" \/><\/p>\n<\/div>\n<div id=\"examples-for-time-series-data\" class=\"section level3\">\n<h3>Examples for time series data<\/h3>\n<pre class=\"r\"><code># Demo data\r\ndf2 &lt;- Orange\r\nhead(df2)<\/code><\/pre>\n<pre><code>## Grouped Data: circumference ~ age | Tree\r\n##   Tree  age circumference\r\n## 1    1  118            30\r\n## 2    1  484            58\r\n## 3    1  664            87\r\n## 4    1 1004           115\r\n## 5    1 1231           120\r\n## 6    1 1372           142<\/code><\/pre>\n<pre class=\"r\"><code># Filter the last values\r\ndata_ends &lt;- df2 %&gt;% \r\n  group_by(Tree) %&gt;% \r\n  top_n(1, age) \r\ndata_ends<\/code><\/pre>\n<pre><code>## # A tibble: 5 x 3\r\n## # Groups:   Tree [5]\r\n##   Tree    age circumference\r\n##   &lt;ord&gt; &lt;dbl&gt;         &lt;dbl&gt;\r\n## 1 1      1582           145\r\n## 2 2      1582           203\r\n## 3 3      1582           140\r\n## 4 4      1582           214\r\n## 5 5      1582           177<\/code><\/pre>\n<pre class=\"r\"><code>ggplot(df2, aes(age, circumference)) +\r\n  geom_line(aes(color = Tree)) +\r\n  geom_text_repel(\r\n    aes(label = circumference), data = data_ends, \r\n    size = 3\r\n    )<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-tutorial\/figures\/ggplot-display-the-last-value-of-each-line-in-the-plot-time-series-1.png\" width=\"576\" \/><\/p>\n<\/div>\n<\/div>\n<div id=\"using-a-secondary-y-axis-to-show-the-line-labels\" class=\"section level2\">\n<h2>Using a secondary y axis to show the line labels<\/h2>\n<p>Key R functions: The ggplot2 <code>scale_y_continuous()<\/code> function is used in combination with the argument <code>sec.axis<\/code> to create a second axis on the right. The numbers to be displayed at breaks is defined by the vector of values corresponding to the line ends.<\/p>\n<pre class=\"r\"><code># Pull the vector of last values\r\ndata_ends &lt;- df2 %&gt;% \r\n  group_by(Tree) %&gt;% \r\n  top_n(1, age) %&gt;%\r\n  pull(circumference)\r\ndata_ends<\/code><\/pre>\n<pre><code>## [1] 145 203 140 214 177<\/code><\/pre>\n<pre class=\"r\"><code># Create the line plot with labels\r\nggplot(df2, aes(x = age, y = circumference)) +\r\n      geom_line(aes(color = Tree)) +\r\n      scale_y_continuous(sec.axis = sec_axis(~ ., breaks = data_ends))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-tutorial\/figures\/ggplot-display-the-last-value-of-each-line-in-the-plot-secondary-axis-1.png\" width=\"576\" \/><\/p>\n<\/div>\n<div id=\"conclusion\" class=\"section level2\">\n<h2>Conclusion<\/h2>\n<p>This article describes how to display the last value of each line as a label.<\/p>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article describes how to display the last value of each line as a label using the ggplot2 R package. Different solutions are provided using either the ggrepel text labeling [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":16542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rating_form_position":"","rating_results_position":"","mr_structured_data_type":"","footnotes":""},"categories":[134],"tags":[131],"class_list":["post-16541","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-visualization","tag-ggplot2-faq"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GGPLOT: How to Display the Last Value of Each Line as Label - Datanovia<\/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:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GGPLOT: How to Display the Last Value of Each Line as Label - Datanovia\" \/>\n<meta property=\"og:description\" content=\"This article describes how to display the last value of each line as a label using the ggplot2 R package. Different solutions are provided using either the ggrepel text labeling [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-28T11:08:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1152\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alboukadel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alboukadel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\"},\"author\":{\"name\":\"Alboukadel\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e\"},\"headline\":\"GGPLOT: How to Display the Last Value of Each Line as Label\",\"datePublished\":\"2020-05-28T11:08:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\"},\"wordCount\":178,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\",\"keywords\":[\"ggplot2 FAQ\"],\"articleSection\":[\"Data Visualization\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\",\"name\":\"GGPLOT: How to Display the Last Value of Each Line as Label - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\",\"datePublished\":\"2020-05-28T11:08:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\",\"width\":1152,\"height\":768,\"caption\":\"ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GGPLOT: How to Display the Last Value of Each Line as Label\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"name\":\"Datanovia\",\"description\":\"Data Mining and Statistics for Decision Support\",\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.datanovia.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\",\"name\":\"Datanovia\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"width\":98,\"height\":99,\"caption\":\"Datanovia\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e\",\"name\":\"Alboukadel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g\",\"caption\":\"Alboukadel\"},\"url\":\"https:\/\/www.datanovia.com\/en\/blog\/author\/kassambara\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GGPLOT: How to Display the Last Value of Each Line as Label - Datanovia","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:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/","og_locale":"en_US","og_type":"article","og_title":"GGPLOT: How to Display the Last Value of Each Line as Label - Datanovia","og_description":"This article describes how to display the last value of each line as a label using the ggplot2 R package. Different solutions are provided using either the ggrepel text labeling [&hellip;]","og_url":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/","og_site_name":"Datanovia","article_published_time":"2020-05-28T11:08:19+00:00","og_image":[{"width":1152,"height":768,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png","type":"image\/png"}],"author":"Alboukadel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Alboukadel","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#article","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/"},"author":{"name":"Alboukadel","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e"},"headline":"GGPLOT: How to Display the Last Value of Each Line as Label","datePublished":"2020-05-28T11:08:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/"},"wordCount":178,"commentCount":2,"publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png","keywords":["ggplot2 FAQ"],"articleSection":["Data Visualization"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/","url":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/","name":"GGPLOT: How to Display the Last Value of Each Line as Label - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png","datePublished":"2020-05-28T11:08:19+00:00","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2020\/05\/ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png","width":1152,"height":768,"caption":"ggplot-display-the-last-value-of-each-line-in-the-plot-basic-line-plot-1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-how-to-display-the-last-value-of-each-line-as-label\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"GGPLOT: How to Display the Last Value of Each Line as Label"}]},{"@type":"WebSite","@id":"https:\/\/www.datanovia.com\/en\/#website","url":"https:\/\/www.datanovia.com\/en\/","name":"Datanovia","description":"Data Mining and Statistics for Decision Support","publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanovia.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanovia.com\/en\/#organization","name":"Datanovia","url":"https:\/\/www.datanovia.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","width":98,"height":99,"caption":"Datanovia"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e","name":"Alboukadel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed3108646c5c7c3d188324ab972f96ad7d9975b41b94014d7f68257791be395a?s=96&d=mm&r=g","caption":"Alboukadel"},"url":"https:\/\/www.datanovia.com\/en\/blog\/author\/kassambara\/"}]}},"multi-rating":{"mr_rating_results":[]},"_links":{"self":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/16541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/comments?post=16541"}],"version-history":[{"count":1,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/16541\/revisions"}],"predecessor-version":[{"id":16544,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/16541\/revisions\/16544"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/16542"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=16541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/categories?post=16541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/tags?post=16541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}