R图:在左上角的空白处打印文本

Chr*_*ris 1 plot r

我有以下基本代码来绘制网格。

grid <- expand.grid( pi=seq(50, 95, 5) / 100, mu2=seq(5, .5, -.5) )
pi <- seq(44, 100, .5) / 100
par( mai=c(.05, .05, .05, .05), oma=c(2.9, 2.9, 0, 0) ) # Make room for label
plot( grid, cex=.5, xlab="", ylab="", cex.axis=.7 )
Run Code Online (Sandbox Code Playgroud)

如红色圆圈所示,如何在左上角绘制文本标签,例如“(A)”?

编辑:“(A)”应按规则的,即水平的阅读方向打印;不垂直于y轴。

在此处输入图片说明

csg*_*pie 5

您可以mtext用来将文本放在页边距之外:

##Look at the help page for further details    
mtext("A", 2, adj=1, line=2)

##To rotate "A", try
mtext("A", 2, adj=5, las=1, padj=-22)
Run Code Online (Sandbox Code Playgroud)

要得到:

在此处输入图片说明