Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am not sure how to use the aes angle in geom_label. I thought this code below would rotate the labels by 45, but it doesn't.

library(ggplot2)
ggplot(data = mtcars[1:4,]) +
  geom_label(aes(x = mpg, y = qsec, label=disp), angle = 45)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

Obviously this does not work for geom_label but for geom_text:

ggplot(data = mtcars[1:4,]) +
  geom_text(aes(x = mpg, y = qsec, label=disp), angle = 45)

From ?geom_text

Currently geom_label does not support the rot parameter and is considerably slower than geom_text.

rot obviously refers to rotation and seems to be a deprecated parameter for angle.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...