{"id":8171,"date":"2018-11-12T23:29:58","date_gmt":"2018-11-12T21:29:58","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?p=8171"},"modified":"2019-12-25T11:22:43","modified_gmt":"2019-12-25T09:22:43","slug":"ggplot-axis-ticks-set-and-rotate-text-labels","status":"publish","type":"post","link":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/","title":{"rendered":"GGPlot Axis Ticks: Set and Rotate Text Labels"},"content":{"rendered":"<div id=\"rdoc\">\n<p>This article describes how to easily set <strong>ggplot axis ticks<\/strong> for both x and y axes. We\u2019ll also explain how to <strong>rotate axis labels<\/strong> by specifying a rotation <em>angle<\/em>.<\/p>\n<p>In this R graphics tutorial, you will learn how to:<\/p>\n<ul>\n<li><strong>Change the font style<\/strong> (size, color and face) of the axis tick mark labels.<\/li>\n<li><strong>Rotate axis text labels<\/strong>. For example, for a vertical x axis text label you can specify the argument <em>angle<\/em> as follow: <code>p + theme(axis.text.x = element_text(angle = 90))<\/code>.<\/li>\n<li><strong>Remove axis ticks mark and text<\/strong>: <code>p + theme(axis.text.x = element_blank(), axis.ticks = element_blank())<\/code>.<\/li>\n<li><strong>Remove grid lines<\/strong> and <strong>customize axis lines<\/strong>.<\/li>\n<li><strong>Customize axis ticks<\/strong> for discrete and continuous axes:\n<ul>\n<li>Manually label \/ <strong>rename<\/strong> tick marks and change the order of items in the plot for a discrete x axis.<\/li>\n<li><strong>Format<\/strong> continuous axis tick labels using <code>percent<\/code>, <code>dollar<\/code> and <code>scientific<\/code> scale transformations.<\/li>\n<li><strong>Change<\/strong> the axis <strong>ticks interval<\/strong> (or breaks) by specifying custom values.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#key-ggplot2-r-functions\">Key ggplot2 R functions<\/a><\/li>\n<li><a href=\"#example-of-plots\">Example of plots<\/a><\/li>\n<li><a href=\"#change-axis-tick-mark-labels\">Change axis tick mark labels<\/a><\/li>\n<li><a href=\"#remove-x-and-y-axis-tick-mark-labels\">Remove x and y axis tick mark labels<\/a><\/li>\n<li><a href=\"#change-axis-lines\">Change axis lines<\/a><\/li>\n<li><a href=\"#customize-continuous-and-discrete-axes\">Customize continuous and discrete axes<\/a>\n<ul>\n<li><a href=\"#discrete-axes\">Discrete axes<\/a><\/li>\n<li><a href=\"#continuous-axes\">Continuous axes<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n<div id=\"key-ggplot2-r-functions\" class=\"section level2\">\n<h2>Key ggplot2 R functions<\/h2>\n<ul>\n<li>Main functions:<\/li>\n<\/ul>\n<p>The following function will be used to modify the axis theme and scale:<\/p>\n<ul>\n<li><em>theme<\/em>(axis.text.x = element_text(), axis.text.y = element_text()). Change the appearance of axes text.<\/li>\n<li><em>theme<\/em>(axis.line = element_line()). Change the axis lines<\/li>\n<li><em>scale_x_discrete<\/em>() and <em>scale_y_discrete<\/em>(). Customize discrete x and y axes, respectively.<\/li>\n<li><em>scale_x_continuous<\/em>() and <em>scale_y_continuous<\/em>(). Customize continuous x and y axes, respectively.<\/li>\n<\/ul>\n<p>The scale functions take the arguments breaks, labels and limits as inputs.<\/p>\n<ul>\n<li>Key ggplot2 theme options to modify the axis line, axis ticks and tick text labels:<\/li>\n<\/ul>\n<pre class=\"r\"><code>theme(\r\n  # Change axis lines\r\n  axis.line = element_line(),\r\n  \r\n  # Change axis ticks text labels: font color, size and face\r\n  axis.text = element_text(),       # Change tick labels for all axes\r\n  axis.text.x = element_text(),     # Change x axis tick labels only\r\n  axis.text.x.top = element_text(), # x axis tick labels on top axis\r\n  axis.text.y = element_text(),     # Change y axis tick labels only\r\n  axis.text.y.right = element_text(),# y  axis tick labels on top axis\r\n  \r\n  # Change axis ticks line: font color, size, linetype and length\r\n  axis.ticks = element_line(),      # Change ticks line fo all axes\r\n  axis.ticks.x = element_line(),    # Change x axis ticks only\r\n  axis.ticks.y = element_line(),    # Change y axis ticks only\r\n  axis.ticks.length = unit(3, \"pt\") # Change the length of tick marks\r\n)<\/code><\/pre>\n<p>Arguments of the helper functions:<\/p>\n<ul>\n<li><code>element_text(color, size, face, family, angle, hjust, vjust)<\/code>. Modify the appearance and the rotation angle of axis texts.<\/li>\n<li><code>element_line(color, size, linetype)<\/code>. Modify the appearance of line elements.<\/li>\n<li><code>unit()<\/code>. Change axis ticks length. Example: unit(4, \u201cpt\u201d).<\/li>\n<\/ul>\n<p>To remove a particular axis text or ticks, use <code>element_blank()<\/code> for the corresponding theme argument. For example to remove all axis ticks, use this: <code>p + theme(axis.ticks = element_blank())<\/code>.<\/p>\n<\/div>\n<div id=\"example-of-plots\" class=\"section level2\">\n<h2>Example of plots<\/h2>\n<p>Start by creating a box plot using the <code>ToothGrowth<\/code> data set:<\/p>\n<pre class=\"r\"><code>library(ggplot2)\r\np &lt;- ggplot(ToothGrowth, aes(x = factor(dose), y = len)) + \r\n  geom_boxplot()\r\np<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-example-1.png\" width=\"518.4\" \/><\/p>\n<\/div>\n<div id=\"change-axis-tick-mark-labels\" class=\"section level2\">\n<h2>Change axis tick mark labels<\/h2>\n<p>The functions <code>theme()<\/code> and <code>element_text()<\/code> are used to set the font size, color and face of axis tick mark labels. You can also specify the argument <code>angle<\/code> in the function <code>element_text()<\/code> to rotate the tick text.<\/p>\n<p>Change the style and the orientation angle of axis tick labels. For a vertical rotation of x axis labels use <code>angle = 90<\/code>.<\/p>\n<pre class=\"r\"><code># Rotate x and y axis text by 45 degree\r\n# face can be \"plain\", \"italic\", \"bold\" or \"bold.italic\"\r\np + theme(axis.text.x = element_text(face = \"bold\", color = \"#993333\", \r\n                           size = 12, angle = 45),\r\n          axis.text.y = element_text(face = \"bold\", color = \"blue\", \r\n                           size = 12, angle = 45))\r\n\r\n# Vertical rotation of x axis text\r\np + theme(axis.text.x = element_text(angle = 90))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-set-axis-ticks-mark-labels-1.png\" width=\"288\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-set-axis-ticks-mark-labels-2.png\" width=\"288\" \/><\/p>\n<p>To adjust the position of the axis text, you can specify the argument <code>hjust<\/code> and <code>vjust<\/code>, which values should be comprised between 0 and 1. For example:<\/p>\n<pre class=\"r\"><code># Create a new simple box plot\r\np2 &lt;- ggplot(iris, aes(Species, Sepal.Length)) +\r\n  geom_boxplot()\r\n\r\n# Rotated but not adjusted x axis text\r\np2 + theme(axis.text.x = element_text(angle = 45))\r\n\r\n# Rotate and adjust x axis text\r\np2 + theme(axis.text.x = element_text(angle = 45, hjust = 1))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-adjust-x-axis-test-1.png\" width=\"518.4\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-adjust-x-axis-test-2.png\" width=\"518.4\" \/><\/p>\n<\/div>\n<div id=\"remove-x-and-y-axis-tick-mark-labels\" class=\"section level2\">\n<h2>Remove x and y axis tick mark labels<\/h2>\n<p>Key function: element_blank()<\/p>\n<pre class=\"r\"><code># Remove x and y axis tick mark labels\r\np + theme(\r\n  axis.text.x = element_blank(),\r\n  axis.text.y = element_blank())\r\n\r\n# Remove axis ticks and tick mark labels\r\np + theme(\r\n  axis.text.x = element_blank(),\r\n  axis.text.y = element_blank(),\r\n  axis.ticks = element_blank())<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-remove-axis-ticks-mark-labels-1.png\" width=\"288\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-remove-axis-ticks-mark-labels-2.png\" width=\"288\" \/><\/p>\n<\/div>\n<div id=\"change-axis-lines\" class=\"section level2\">\n<h2>Change axis lines<\/h2>\n<ul>\n<li>Key function: <code>theme()<\/code> and <code>element_line()<\/code><\/li>\n<li>Allowed values for line types: (\u201cblank\u201d, \u201csolid\u201d, \u201cdashed\u201d, \u201cdotted\u201d, \u201cdotdash\u201d, \u201clongdash\u201d, \u201ctwodash\u201d) or number (0, 1, 2, 3, 4, 5, 6). <code>linetype = \"solid\"<\/code> is identical to <code>linetype = 1<\/code>.<\/li>\n<\/ul>\n<p>Change the color, the size and the line type of axis lines:<\/p>\n<pre class=\"r\"><code>p + theme( \r\n  axis.line = element_line(color = \"darkblue\", \r\n                           size = 1, linetype = \"solid\")\r\n  )<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-change-axis-line-1.png\" width=\"288\" \/><\/p>\n<\/div>\n<div id=\"customize-continuous-and-discrete-axes\" class=\"section level2\">\n<h2>Customize continuous and discrete axes<\/h2>\n<p>x or y axis can be discrete (grouping variable) or continuous (numeric variable). In each of these two cases, the functions to be used for setting axis ticks are different.<\/p>\n<p>Key ggplot2 R functions:<\/p>\n<ul>\n<li>Discrete axes:\n<ul>\n<li>scale_x_discrete(name, breaks, labels, limits): for x axis<\/li>\n<li>scale_y_discrete(name, breaks, labels, limits): for y axis<\/li>\n<\/ul>\n<\/li>\n<li>Continuous axes:\n<ul>\n<li>scale_x_continuous(name, breaks, labels, limits, trans): for x axis<\/li>\n<li>scale_y_continuous(name, breaks, labels, limits, trans): for x axis<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Function arguments definition:<\/p>\n<ul>\n<li><code>name<\/code>: x or y axis labels<\/li>\n<li><code>breaks<\/code>: vector specifying which breaks to display<\/li>\n<li><code>labels<\/code>: labels of axis tick marks<\/li>\n<li><code>limits<\/code>: vector indicating the data range<\/li>\n<\/ul>\n<p><code>The scale_xx()<\/code> functions can be used to change the following x or y axis parameters :<\/p>\n<ul>\n<li>axis titles or labels<\/li>\n<li>axis limits (data range to display)<\/li>\n<li>choose where tick marks appear<\/li>\n<li>manually label tick marks<\/li>\n<\/ul>\n<div id=\"discrete-axes\" class=\"section level3\">\n<h3>Discrete axes<\/h3>\n<p>In the examples below, we\u2019ll use only the functions <code>scale_x_discrete()<\/code> and <code>xlim()<\/code> to customize x axis tick marks. The same type of examples can be applied to a discrete y axis using the functions <code>scale_y_discrete()<\/code> and <code>ylim()<\/code>.<\/p>\n<pre class=\"r\"><code># Change x axis label and the order of items\r\np + scale_x_discrete(name =\"Dose (mg)\", \r\n                    limits=c(\"2\",\"1\",\"0.5\"))\r\n\r\n# Rename \/ Change tick mark labels\r\np + scale_x_discrete(breaks=c(\"0.5\",\"1\",\"2\"),\r\n        labels=c(\"D0.5\", \"D1\", \"D2\"))\r\n\r\n# Choose which items to display\r\np + scale_x_discrete(limits=c(\"0.5\", \"2\"))\r\n\r\n# or use this:\r\n# p + xlim(\"0.5\", \"2\") # same as above<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-customize-discrete-x-axis-order-of-items-1.png\" width=\"192\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-customize-discrete-x-axis-order-of-items-2.png\" width=\"192\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-customize-discrete-x-axis-order-of-items-3.png\" width=\"192\" \/><\/p>\n<\/div>\n<div id=\"continuous-axes\" class=\"section level3\">\n<h3>Continuous axes<\/h3>\n<ul>\n<li>Create a simple scatter plot<\/li>\n<li>Change axis labels and limits. Break axis by a user defined value.<\/li>\n<\/ul>\n<pre class=\"r\"><code># Simple scatter plot\r\nsp &lt;- ggplot(cars, aes(x = speed, y = dist)) + geom_point()\r\nsp\r\n\r\n\r\n# Change x and y axis labels, and limits\r\nsp + scale_x_continuous(name=\"Speed of cars\", limits=c(0, 30)) +\r\n  scale_y_continuous(name=\"Stopping distance\", limits=c(0, 150))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-continuous-axis-labels-limits-breaks-1.png\" width=\"192\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-continuous-axis-labels-limits-breaks-2.png\" width=\"192\" \/><\/p>\n<ul>\n<li>Change axis ticks interval:<\/li>\n<\/ul>\n<pre class=\"r\"><code># Break y axis by a specified value\r\n# a tick mark is shown on every 50\r\nsp + scale_y_continuous(breaks=seq(0, 150, 50))\r\n\r\n# Tick marks can be spaced randomly\r\nsp + scale_y_continuous(breaks=c(0, 50, 65, 75, 150))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-axis-ticks-interval-scale_y_continuous-breaks-1.png\" width=\"192\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-axis-ticks-interval-scale_y_continuous-breaks-2.png\" width=\"192\" \/><\/p>\n<ul>\n<li>Remove tick mark labels and gridlines<\/li>\n<li>Format axis tick labels. Possible values for labels are comma, percent, dollar and scientific. For more examples, read the documentation of the function trans_new() in the <code>scales<\/code> R package.<\/li>\n<\/ul>\n<pre class=\"r\"><code># Remove y tick mark labels and grid lines\r\nsp + scale_y_continuous(breaks=NULL)\r\n\r\n# Format y axis labels in percent (%)\r\nrequire(scales)\r\nsp + scale_y_continuous(labels = percent) <\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-remove-ticks-scale_y_continuous-percent-1.png\" width=\"192\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/023-ggplot-axis-ticks-remove-ticks-scale_y_continuous-percent-2.png\" width=\"192\" \/><\/p>\n<p>For <code>dollar<\/code> and <code>scientific<\/code> formats, type this:<\/p>\n<pre class=\"r\"><code>require(scales)\r\n\r\n# Dollar\r\np + scale_y_continuous(labels = dollar)\r\n\r\n# Scientific\r\np + scale_y_continuous(labels = scientific)<\/code><\/pre>\n<\/div>\n<\/div>\n<div id=\"conclusion\" class=\"section level2\">\n<h2>Conclusion<\/h2>\n<ul>\n<li>Create an example of ggplot:<\/li>\n<\/ul>\n<pre class=\"r\"><code>library(ggplot2)\r\np &lt;- ggplot(iris, aes(Species, Sepal.Length)) +\r\n  geom_boxplot()<\/code><\/pre>\n<ul>\n<li>Change tick font:<\/li>\n<\/ul>\n<pre class=\"r\"><code># Change tick text for both x and y axis\r\np + theme(\r\n  axis.text = element_text(size = 11, color = \"blue\")\r\n)\r\n# Change tick text for x axis ony\r\np + theme(axis.text.x = element_text(color = \"blue\", face = \"italic\"))<\/code><\/pre>\n<ul>\n<li>Rotate x axis text:<\/li>\n<\/ul>\n<pre class=\"r\"><code># Vertical rotation: 90 degree\r\np + theme(\r\n  axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)\r\n)\r\n# Rotate by 45 degree\r\np + theme(\r\n  axis.text.x = element_text(angle = 45, hjust = 1)\r\n  )<\/code><\/pre>\n<ul>\n<li>Remove x axis ticks and rename tick labels:<\/li>\n<\/ul>\n<pre class=\"r\"><code>p + theme(axis.ticks.x = element_blank())+\r\n  scale_x_discrete(\r\n    breaks=c(\"setosa\",\"versicolor\",\"virginica\"),\r\n    labels=c(\"SE\", \"VE\", \"VI\")\r\n    )<\/code><\/pre>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article describes how to easily set ggplot axis ticks for both x and y axes. We\u2019ll also explain how to rotate axis labels by specifying a rotation angle. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7929,"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":[315],"class_list":["post-8171","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ggplot2","tag-ggplot2-graphical-parameters"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Customize GGPLot Axis Ticks for Great Visualization - Datanovia<\/title>\n<meta name=\"description\" content=\"You will learn how to customize ggplot axis ticks; remove axis ticks mark and text; remove grid lines and customize axis lines; and change the font style.\" \/>\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-axis-ticks-set-and-rotate-text-labels\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Customize GGPLot Axis Ticks for Great Visualization - Datanovia\" \/>\n<meta property=\"og:description\" content=\"You will learn how to customize ggplot axis ticks; remove axis ticks mark and text; remove grid lines and customize axis lines; and change the font style.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-12T21:29:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-25T09:22:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.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=\"7 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-axis-ticks-set-and-rotate-text-labels\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/\"},\"author\":{\"name\":\"Alboukadel\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e\"},\"headline\":\"GGPlot Axis Ticks: Set and Rotate Text Labels\",\"datePublished\":\"2018-11-12T21:29:58+00:00\",\"dateModified\":\"2019-12-25T09:22:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/\"},\"wordCount\":729,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg\",\"keywords\":[\"GGPLOT2 Graphical Parameters\"],\"articleSection\":[\"ggplot2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/\",\"name\":\"How to Customize GGPLot Axis Ticks for Great Visualization - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg\",\"datePublished\":\"2018-11-12T21:29:58+00:00\",\"dateModified\":\"2019-12-25T09:22:43+00:00\",\"description\":\"You will learn how to customize ggplot axis ticks; remove axis ticks mark and text; remove grid lines and customize axis lines; and change the font style.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GGPlot Axis Ticks: Set and Rotate Text Labels\"}]},{\"@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":"How to Customize GGPLot Axis Ticks for Great Visualization - Datanovia","description":"You will learn how to customize ggplot axis ticks; remove axis ticks mark and text; remove grid lines and customize axis lines; and change the font style.","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-axis-ticks-set-and-rotate-text-labels\/","og_locale":"en_US","og_type":"article","og_title":"How to Customize GGPLot Axis Ticks for Great Visualization - Datanovia","og_description":"You will learn how to customize ggplot axis ticks; remove axis ticks mark and text; remove grid lines and customize axis lines; and change the font style.","og_url":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/","og_site_name":"Datanovia","article_published_time":"2018-11-12T21:29:58+00:00","article_modified_time":"2019-12-25T09:22:43+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg","type":"image\/jpeg"}],"author":"Alboukadel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Alboukadel","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#article","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/"},"author":{"name":"Alboukadel","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/person\/7767cf2bd5c91a1610c6eb53a0ff069e"},"headline":"GGPlot Axis Ticks: Set and Rotate Text Labels","datePublished":"2018-11-12T21:29:58+00:00","dateModified":"2019-12-25T09:22:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/"},"wordCount":729,"commentCount":7,"publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg","keywords":["GGPLOT2 Graphical Parameters"],"articleSection":["ggplot2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/","url":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/","name":"How to Customize GGPLot Axis Ticks for Great Visualization - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg","datePublished":"2018-11-12T21:29:58+00:00","dateModified":"2019-12-25T09:22:43+00:00","description":"You will learn how to customize ggplot axis ticks; remove axis ticks mark and text; remove grid lines and customize axis lines; and change the font style.","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/El_Classico.jpg","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/blog\/ggplot-axis-ticks-set-and-rotate-text-labels\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"GGPlot Axis Ticks: Set and Rotate Text Labels"}]},{"@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\/8171","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=8171"}],"version-history":[{"count":1,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8171\/revisions"}],"predecessor-version":[{"id":8172,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/posts\/8171\/revisions\/8172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/7929"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=8171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/categories?post=8171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/tags?post=8171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}