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

问题描述

我不知道如何在

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

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

从?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

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

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

10-19 13:34