2

我正在尝试将文本添加到使用基本 R 函数构建的马赛克图中的单个图块中。但是,我无法确定每个中心图块的坐标。

不,我需要将其限制为镶嵌图功能并且不想使用 vcd 包。下面的代码演示了基于知道应该去哪里添加文本。我怎样才能得出这些坐标?

require(stats) 
attach(Titanic)
mosaicplot(~  Sex + Survived, data = Titanic) 
text( .4,.6, "where to get this number ?",col = "red", cex = 2) 
text( .4,.1, "and how to find coordinates ?",col = "blue", cex = 1.5)
4

0 回答 0