简体   繁体   English

绘图窗口中的 corrplot 边距

[英]corrplot margin in plot window

I entered the commands below to develop a core plot.我输入了下面的命令来开发一个核心图。 It works, but the plot shows up sandwiched against the bottom margin.它有效,但情节显示夹在底部边缘。 Changing par(mar=c(5, 4, 4, 2) + 0.1) parameters has no impact on the placement of the corrplot.更改 par(mar=c(5, 4, 4, 2) + 0.1) 参数对 corrplot 的放置没有影响。 Ideas?想法?

library(corrplot)
a <- seq(1,10,1)
b <- seq(2,20,2)
c <- seq(3,30,3)
z <- data.frame(a,b,c)
corrplot(cor(z))

将边距直接添加到corrplot()调用中,如下所示:

corrplot(cor(z), mar = c(1, 1, 1, 1))

I was running into trouble with this because setting margins within the function still clipped the axis labels, which in my case were relatively long site names.我遇到了这个问题,因为在函数中设置边距仍然会剪切轴标签,在我的情况下是相对较长的站点名称。 If you have long names for the rows/columns, in addition to using a mar() call within corrplot(), you may first need to call par(xpd = TRUE) to allow plotting in the margins.如果行/列的名称很长,除了在 corrplot() 中使用 mar() 调用之外,您可能首先需要调用 par(xpd = TRUE) 以允许在边距中绘图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM