Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
以45度角在R中的方框图中插入标签?_R - Fatal编程技术网

以45度角在R中的方框图中插入标签?

以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

在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), 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);

这里有一些更好的代码:这里有一些更好的代码: