首页 > 解决方案 > 绘制 RandomFields 包中的对象时出现奇怪的蓝色字幕

问题描述

将轴标签参数传递给函数时,该plot方法会RFspatialGridDataFrame输出一个奇怪的蓝色“字幕” 。mainplot

install.packages("RandomFields")
library(RandomFields)

model <- RPbernoulli(RMexp(scale = 3), threshold = 1)
set.seed(100)
simulation <- RFsimulate(model, x = 1:138, y = 1:74)
plot(simulation, main = "This is an example title")

以下是输出的截图

在此处输入图像描述

奇怪的是,这似乎是一个功能,正如运行 RandomFields 文档的其他示例所示。

有没有办法不输出这个蓝色的重复标题?我曾尝试摆弄其他图形参数(例如 setting legend = F),但行为没有改变。

标签: rplot

解决方案


我已经联系了RandomFields包的维护者,它似乎是RFoptions.

通过RFoptions(grPrintlevel = 0)在绘图之前设置,可以避免这种行为。?RFoptions有关图形的更多信息,请参见第 10 节。有关grPrintlevel读取的相关部分

grPrintlevel: integer values 0, 1, 2; only relevant when simulations are 
plotted. The higher the more text is shown in the plot.
Default: 1.

推荐阅读