{"id":8419,"date":"2019-01-12T23:10:55","date_gmt":"2019-01-12T21:10:55","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?p=8419"},"modified":"2019-12-25T11:00:29","modified_gmt":"2019-12-25T09:00:29","slug":"ggplot-aes-how-to-assign-aesthetics-in-ggplot2","status":"publish","type":"post","link":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/","title":{"rendered":"GGPlot AES: How to Assign Aesthetics in GGPlot2"},"content":{"rendered":"<div id=\"rdoc\">\n<p>In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).<\/p>\n<p>These visual caracteristics are known as <strong>aesthetics<\/strong> (or <strong>aes<\/strong>) and include:<\/p>\n<ul>\n<li>color and fill<\/li>\n<li>points shape<\/li>\n<li>line type<\/li>\n<li>size<\/li>\n<li>group<\/li>\n<li>etc<\/li>\n<\/ul>\n<p>Aesthetic mappings can be defined in <code>ggplot()<\/code> and in individual layers (such as <code>geom_point()<\/code>, <code>geom_line()<\/code>, etc).<\/p>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n<li><a href=\"#basics\">Basics<\/a><\/li>\n<li><a href=\"#color-and-fill\">Color and fill<\/a><\/li>\n<li><a href=\"#shape\">Shape<\/a><\/li>\n<li><a href=\"#group-and-line-type\">Group and line type<\/a><\/li>\n<li><a href=\"#label\">Label<\/a><\/li>\n<li><a href=\"#create-wrappers-around-ggplot2-pipelines\">Create wrappers around ggplot2 pipelines<\/a><\/li>\n<\/ul>\n<\/div>\n<div class='dt-sc-hr-invisible-medium  '><\/div>\n<div class='dt-sc-ico-content type1'><div class='custom-icon' ><a href='https:\/\/www.datanovia.com\/en\/product\/ggplot2-essentials-for-great-data-visualization-in-r\/' target='_blank'><span class='fa fa-book'><\/span><\/a><\/div><h4><a href='https:\/\/www.datanovia.com\/en\/product\/ggplot2-essentials-for-great-data-visualization-in-r\/' target='_blank'> Related Book <\/a><\/h4>GGPlot2 Essentials for Great Data Visualization in R<\/div>\n<div class='dt-sc-hr-invisible-medium  '><\/div>\n<div id=\"prerequisites\" class=\"section level2\">\n<h2>Prerequisites<\/h2>\n<p>Load required packages and set the theme function <code>theme_bw()<\/code> as the default theme:<\/p>\n<pre class=\"r\"><code>library(ggplot2) \r\ntheme_set(theme_bw())<\/code><\/pre>\n<\/div>\n<div id=\"basics\" class=\"section level2\">\n<h2>Basics<\/h2>\n<p>Map aesthetics to variables and to functions of variables:<\/p>\n<pre class=\"r\"><code># Map aesthetics to variables\r\nggplot(ToothGrowth, aes(x = supp, y = len)) +\r\n  geom_boxplot()\r\n\r\n# Map aesthetics to functions of variables\r\nggplot(mtcars, aes(x = mpg ^ 2, y = wt \/ cyl)) +\r\n  geom_point()<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-basics-1.png\" width=\"288\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-basics-2.png\" width=\"288\" \/><\/p>\n<p>Aesthetics can be also mapped to constants:<\/p>\n<pre class=\"r\"><code># map x to constant: 1\r\nggplot(ToothGrowth, aes(x = factor(1), y = len)) +\r\n  geom_boxplot(width = 0.5) +\r\n  geom_jitter(width = 0.1)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-constant-1.png\" width=\"288\" \/><\/p>\n<div class=\"warning\">\n<p>Note that, aes() is passed to either ggplot() or to specific layer. Aesthetics specified to ggplot() are used as defaults for every layer.<\/p>\n<\/div>\n<p>For example:<\/p>\n<pre class=\"r\"><code># Use this \r\nggplot(mpg, aes(displ, hwy)) + geom_point()\r\n\r\n# or this\r\nggplot(mpg) + geom_point(aes(displ, hwy))<\/code><\/pre>\n<\/div>\n<div id=\"color-and-fill\" class=\"section level2\">\n<h2>Color and fill<\/h2>\n<pre class=\"r\"><code># Color\r\nggplot(ToothGrowth, aes(supp, len)) +\r\n  geom_boxplot(aes(color = supp))\r\n\r\n# Fill\r\nggplot(ToothGrowth, aes(supp, len)) +\r\n  geom_boxplot(aes(fill = supp))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-color-and-fill-1.png\" width=\"336\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-color-and-fill-2.png\" width=\"336\" \/><\/p>\n<\/div>\n<div id=\"shape\" class=\"section level2\">\n<h2>Shape<\/h2>\n<p>Change point shapes by groups:<\/p>\n<pre class=\"r\"><code>ggplot(iris, aes(Sepal.Length, Sepal.Width)) +\r\n  geom_point(aes(shape = Species))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-shape-1.png\" width=\"336\" \/><\/p>\n<\/div>\n<div id=\"group-and-line-type\" class=\"section level2\">\n<h2>Group and line type<\/h2>\n<p>In line plot, for example, group aesthetic is used to ensure lines are drawn separately for each group<\/p>\n<pre class=\"r\"><code># Data\r\ndf2 &lt;- data.frame(supp=rep(c(\"VC\", \"OJ\"), each=3),\r\n                dose=rep(c(\"D0.5\", \"D1\", \"D2\"),2),\r\n                len=c(6.8, 15, 33, 4.2, 10, 29.5))\r\n\r\nhead(df2, 4)<\/code><\/pre>\n<pre><code>##   supp dose  len\r\n## 1   VC D0.5  6.8\r\n## 2   VC   D1 15.0\r\n## 3   VC   D2 33.0\r\n## 4   OJ D0.5  4.2<\/code><\/pre>\n<pre class=\"r\"><code># Create a grouped line plot\r\nggplot(df2, aes(dose, len, group = supp)) +\r\n  geom_line() +\r\n  geom_point()\r\n\r\n\r\n# Change linetype by groups\r\nggplot(df2, aes(dose, len, group = supp)) +\r\n  geom_line(aes(linetype = supp)) +\r\n  geom_point()<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-group-and-line-type-1.png\" width=\"288\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-group-and-line-type-2.png\" width=\"288\" \/><\/p>\n<\/div>\n<div id=\"label\" class=\"section level2\">\n<h2>Label<\/h2>\n<pre class=\"r\"><code>ggplot(df2, aes(dose, len, group = supp)) +\r\n  geom_line() +\r\n  geom_point() +\r\n  geom_text(aes(label = len, vjust = -0.5))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-label-1.png\" width=\"288\" \/><\/p>\n<\/div>\n<div id=\"create-wrappers-around-ggplot2-pipelines\" class=\"section level2\">\n<h2>Create wrappers around ggplot2 pipelines<\/h2>\n<p><code>aes()<\/code> automatically quotes all its arguments, so you need to use tidy-evaluation to create wrappers around ggplot2 pipelines.<\/p>\n<ol style=\"list-style-type: decimal;\">\n<li>Simplest case: your wrapper takes dots<\/li>\n<\/ol>\n<pre class=\"r\"><code>scatter_plot &lt;- function(data, ...) {\r\n  ggplot(data) + geom_point(aes(...))\r\n}\r\nscatter_plot(mtcars, disp, drat)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-wrapper-with-dots-1.png\" width=\"288\" \/><\/p>\n<ol style=\"list-style-type: decimal;\" start=\"2\">\n<li>Your wrapper has named arguments. You need \u201cenquote and unquote\u201d<\/li>\n<\/ol>\n<pre class=\"r\"><code>scatter_plot &lt;- function(data, x, y) {\r\n  x &lt;- enquo(x)\r\n  y &lt;- enquo(y)\r\n\r\n  ggplot(data) + geom_point(aes(!!x, !!y))\r\n}\r\nscatter_plot(mtcars, disp, drat)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-wrapper-with-named-argument-1.png\" width=\"288\" \/><\/p>\n<div class=\"warning\">\n<p>Note that, users of your wrapper can use their own functions in the quoted expressions.<\/p>\n<\/div>\n<pre class=\"r\"><code>cut3 &lt;- function(x) cut_number(x, 3)\r\nscatter_plot(mtcars, cut3(disp), drat)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/127-ggplot-aes-using-functions-in-wrapper-1.png\" width=\"288\" \/><\/p>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc). These visual caracteristics are known as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7949,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rating_form_position":"","rating_results_position":"","mr_structured_data_type":"","footnotes":""},"categories":[124],"tags":[131],"class_list":["post-8419","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ggplot2","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 AES: How to Assign Aesthetics in GGPlot2 - Datanovia<\/title>\n<meta name=\"description\" content=\"In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).\" \/>\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-aes-how-to-assign-aesthetics-in-ggplot2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GGPlot AES: How to Assign Aesthetics in GGPlot2 - Datanovia\" \/>\n<meta property=\"og:description\" content=\"In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-12T21:10:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-25T09:00:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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-aes-how-to-assign-aesthetics-in-ggplot2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/\"},\"author\":{\"name\":\"Alboukadel\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e\"},\"headline\":\"GGPlot AES: How to Assign Aesthetics in GGPlot2\",\"datePublished\":\"2019-01-12T21:10:55+00:00\",\"dateModified\":\"2019-12-25T09:00:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/\"},\"wordCount\":267,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg\",\"keywords\":[\"ggplot2 FAQ\"],\"articleSection\":[\"ggplot2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/\",\"name\":\"GGPlot AES: How to Assign Aesthetics in GGPlot2 - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg\",\"datePublished\":\"2019-01-12T21:10:55+00:00\",\"dateModified\":\"2019-12-25T09:00:29+00:00\",\"description\":\"In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GGPlot AES: How to Assign Aesthetics in GGPlot2\"}]},{\"@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 AES: How to Assign Aesthetics in GGPlot2 - Datanovia","description":"In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).","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-aes-how-to-assign-aesthetics-in-ggplot2\/","og_locale":"en_US","og_type":"article","og_title":"GGPlot AES: How to Assign Aesthetics in GGPlot2 - Datanovia","og_description":"In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).","og_url":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/","og_site_name":"Datanovia","article_published_time":"2019-01-12T21:10:55+00:00","article_modified_time":"2019-12-25T09:00:29+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg","type":"image\/jpeg"}],"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-aes-how-to-assign-aesthetics-in-ggplot2\/#article","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/"},"author":{"name":"Alboukadel","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e"},"headline":"GGPlot AES: How to Assign Aesthetics in GGPlot2","datePublished":"2019-01-12T21:10:55+00:00","dateModified":"2019-12-25T09:00:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/"},"wordCount":267,"commentCount":0,"publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg","keywords":["ggplot2 FAQ"],"articleSection":["ggplot2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/","url":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/","name":"GGPlot AES: How to Assign Aesthetics in GGPlot2 - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg","datePublished":"2019-01-12T21:10:55+00:00","dateModified":"2019-12-25T09:00:29+00:00","description":"In this article, you will learn how to map variables in the data to visual properpeties of ggplot geoms (points, bars, box plot, etc).","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/c9.jpg","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-aes-how-to-assign-aesthetics-in-ggplot2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"GGPlot AES: How to Assign Aesthetics in GGPlot2"}]},{"@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\/8419","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=8419"}],"version-history":[{"count":1,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8419\/revisions"}],"predecessor-version":[{"id":8420,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8419\/revisions\/8420"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/7949"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=8419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/categories?post=8419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/tags?post=8419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}