plot.design comand(倾斜)处的因素倾斜水平

时间:2018-09-05 22:29:48

标签: r plot

我想在r的plot.design命令中倾斜因子的水平

require(stats)
plot.design(warpbreaks)

如果我执行上面的代码,该图将显示水平方向的水平,但是我想将水平倾斜45度。这将有助于我更好地显示我的应用水平 任何想法如何做到这一点?

1 个答案:

答案 0 :(得分:0)

在ggplot2之外执行此操作比较麻烦,但是可行。

plot.design(warpbreaks, axes = FALSE) # plot with no axes
axis(2) # add y as predefined by default
# manually add text in place of the label
text(1:2, par("usr")[3], labels = c("wool", "tension"), srt = 45, adj = c(1.1,1.1), xpd = TRUE)
box() # you need this to have the square around your image