如何在geom_label中使用角度? [英] How to use angle in geom_label?

查看:248
本文介绍了如何在geom_label中使用角度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何在 geom_label 中使用aes angle 。我认为下面的代码会将标签旋转45,但它不会。

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


解决方案

很明显,这对于 geom_label code> geom_text :

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

?geom_text


目前geom_label不支持 rot 参数,并且比 geom_text 慢得多。


rot 显然是指旋转角度,似乎是角度的弃用参数。

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)

解决方案

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.

这篇关于如何在geom_label中使用角度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆