以45度角在R中的方框图中插入标签?
在boxplot()命令中是否有任何方法可以将标签旋转45度以45度角在R中的方框图中插入标签?,r,R,在boxplot()命令中是否有任何方法可以将标签旋转45度 我意识到las=2命令将它们旋转为垂直于x轴,但我希望它们为45度 以下内容如何: # Some sample data x <- list(x = rnorm(100, 2), y = rnorm(100, 4)); # Plot without x axis boxplot(x, xaxt = "n"); # Add axis labels rotated by 45 degrees text(seq_along(x), p
我意识到las=2命令将它们旋转为垂直于x轴,但我希望它们为45度 以下内容如何:
# Some sample data
x <- list(x = rnorm(100, 2), y = rnorm(100, 4));
# Plot without x axis
boxplot(x, xaxt = "n");
# Add axis labels rotated by 45 degrees
text(seq_along(x), par("usr")[3] - 0.5, labels = names(x), srt = 45, adj = 1, xpd = TRUE);
以下内容如何:
# Some sample data
x <- list(x = rnorm(100, 2), y = rnorm(100, 4));
# Plot without x axis
boxplot(x, xaxt = "n");
# Add axis labels rotated by 45 degrees
text(seq_along(x), par("usr")[3] - 0.5, labels = names(x), srt = 45, adj = 1, xpd = TRUE);
这里有一些更好的代码:这里有一些更好的代码: