From the course: Data Visualization in R with ggplot2
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Adding titles
- [Instructor] Titles are an important part of any visualization. Titles may be used to help explain a visualization or to provide analysis and interpretation of the results. The ggtitle function allows us to add both titles and subtitles to a ggplot visualization. The ggtitle function is pretty simple, so let's dive in and give it a try. I have the code here to create the bar chart that we've been using throughout this course. Let me go ahead and run that. And, I'd like to add a title to this visualization. I can do that by simply adding the ggtitle call to the end of the call to ggplot. I just add ggtitle and then I just provide the title that I would like to use. I'd like to provide a little bit of interpretation here so, my title is going to be more colleges are in the southern United States than any other region. I'm going to go ahead and create my visualization again. That title now appears across the top of the screen. I can also add subtitles. I might use a subtitle to provide…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.