Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.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
使用;GRX";及;grconvertY“;在R中的28个多点绘图案例中查找面板位置的中间和中间位置_R_Plot - Fatal编程技术网

使用;GRX";及;grconvertY“;在R中的28个多点绘图案例中查找面板位置的中间和中间位置

使用;GRX";及;grconvertY“;在R中的28个多点绘图案例中查找面板位置的中间和中间位置,r,plot,R,Plot,我有一个可容纳28个地块的空平台: par(mfcol = c(7, 4), mar = rep(.1, 4), oma = rep(7, 4)) invisible(lapply(1:28, plot, t = "n", xaxt = "n", yaxt = "n")) 问题: 我正在尝试添加一些标签标签位置如下图所示(面板中间(蓝点)和面板间隙(箭头)之间)。 使用“grconvertX”和“grconvertY”,我想知道如何找到我在下图中显示的所有点的位置 对于沿x轴和y轴的中间位置

我有一个可容纳28个地块的空平台:

par(mfcol = c(7, 4), mar = rep(.1, 4), oma = rep(7, 4))

invisible(lapply(1:28, plot, t = "n", xaxt = "n", yaxt = "n"))
问题: 我正在尝试添加一些标签标签位置如下图所示(面板中间(蓝点)和面板间隙(箭头)之间)。

使用“
grconvertX
”和“
grconvertY
”,我想知道如何找到我在下图中显示的所有点的位置

对于沿x轴和y轴的中间位置(蓝色点),以下操作非常完美:

(at <- seq(grconvertX(0 + (1 / 8), "nic"), grconvertX(1 - (1 / 8), "nic"), l = 4))

(at <- seq(grconvertY(0 + (1 / 14), "nic"), grconvertY(1 - (1 / 14), "nic"), l = 7))

(箭头处的位置正好是[-length(at)]+diff(at)[1L]/2
你已经有了这些,不是吗?
abline(v=grconvertX(0:1,'nic'),xpd=NA)
FYI,你可以在使用
par('mfg')创建完所有小图形后,再移动它们
,例如,您可以用
par(mfg=c(7,1));title(ylab='ylab',xlab='xlab',xpd=NA,mgp=c(0,0,0))
或第四行第四列图形加上
par(mfg=c(4,4));点(grconvertX(1,'nfc'),grconvertY(.5,'nfc'),pch=16,xpd=NA)
。但这并不像你现在所做的那样一次完成所有的工作。如果你已经计算了所有的坐标,为什么不直接使用
text
,而不是
mtext(line=)
,它是基于设备尺寸的相对值?
text(grconvertX(0,'nic'),gap.y,l,xpd=NA,adj=1)
NA和
TRUE
之间有细微的区别;我一直使用
NA
,但基本上
TRUE
不会在
oma
区域绘制,而
NA
会在任何地方绘制:
par(oma=c(1,2,1,2));绘图(0);abline(h=0,xpd=FALSE);abline(h=0,xpd=TRUE,col=2);abline(h=0)(h=-.5,xpd=NA,col=3)
;从技术上讲,这些是绘图(黑色)、图形(红色)和设备(绿色)区域