Plot Labels
This lesson is called Plot Labels, part of the Fundamentals of R course. This lesson is called Plot Labels, part of the Fundamentals of R course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Your Turn
Complete the plot labels sections of the data-visualization-exercises.Rmd file.
Learn More
Plot Labels Resources
Chapter 22 of Fundamentals of Data Visualization
Information about using position = "dodge" can be found on the tidyverse website. To see all position adjustments, check out the ggplot2 reference page.
Have any questions? Put them below and we will help you out!
Course Content
34 Lessons
1
The Grammar of Graphics
04:39
2
Scatterplots
03:46
3
Histograms
05:47
4
Bar Charts
06:37
5
Setting color and fill Aesthetic Properties
02:39
6
Setting color and fill Scales
05:40
7
Setting x and y Scales
03:09
8
Adding Text to Plots
07:32
9
Plot Labels
03:57
10
Themes
02:19
11
Facets
03:12
12
Save Plots
02:57
13
Bring it All Together (Data Visualization)
06:42
You need to be signed-in to comment on this post. Login.
Jodi Fender • April 13, 2021
I need to do some more googling, but am trying to figure out how to have labels center on the bars - like in your example here with 3 variables (age, height, gender). I have 2 variables each with two categories and a continuous "Score" but the score for both levels is showing up in the center of the two bars rather than on the center of EACH bar. Maybe this is hard to explain here. If I don't have time to figure it out AND my question isn't clear for you to answer here, I'll submit my with the weird bar labels for feedback. Second, when I try to apply the scale_y_continuous by bars keep disappearing. I can get it to work sometimes but then suddenly it stops plotting. I guess I'll post that on my GitHub submission too. Oh! Maybe when I get to facets, I can have small multiples and bypass the issue of the centered labels...haha. But I do want to figure it out for the future.
Jodi Fender • April 13, 2021
I got somewhere with the geom_text position related to the dodging! Learning how/what to google is exciting: geom_text(aes(label = mean_standard_score), position = position_dodge(width = 1), hjust = 1.5, color = "white")