Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ggplot2 Essentials

You're reading from   ggplot2 Essentials Explore the full range of ggplot2 plotting capabilities to create meaningful and spectacular graphs

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785283529
Length 234 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Donato Teutonico Donato Teutonico
Author Profile Icon Donato Teutonico
Donato Teutonico
Arrow right icon
View More author details
Toc

The plot title and axis labels


As you saw when creating a plot with ggplot2, the default result will be a plot without any title and with axis labels corresponding to the names of the variables represented in the plot. In many cases, you will want to personalize things such as labels, particularly if you are interested in including not only the name of the variable, but also its units. Alternatively, you might also be interested in providing more descriptive labels than simply the title of the variable. In this section, we will see examples of how to change three different types of details: how to change the title and labels of the axis, how to change the scale represented in the x and y axes, and how to remove them if you don't want to have them in the plot.

In order to change the plot title, there are two main options that you can choose from:

  • There is the possibility of changing the title and axis label using specific functions: ggtitle() for the title and xlab() and ylab() for the axes...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image