gpt4 book ai didi

r - .External.graphics R 中的错​​误

转载 作者:行者123 更新时间:2023-12-01 16:42:30 25 4
gpt4 key购买 nike

我使用下面的函数从 48 列 X 32 行的矩阵创建热图:

heatmap.2(all.data,Rowv = FALSE, Colv = FALSE, trace="none",main="All data",col=colorRampPalette(c("green","yellow","red")))

由于删除了树状图,它给了我一些警告,但它仍然给了我想要的热图加上颜色键,发生了一些事情,现在当我尝试运行相同的东西时,它给了我没有颜色的图 key 和错误:

Error in plot.new() : figure margins too large
In addition: Warning messages:
1: In heatmap.2(all.data, Rowv = FALSE, Colv = FALSE, trace = "none", :
Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
2: In heatmap.2(all.data, Rowv = FALSE, Colv = FALSE, trace = "none", :
Discrepancy: Colv is FALSE, while dendrogram is `none'. Omitting column dendogram.

如果我将所有边的边距更改为 1:

par(mar=c(1,1,1,1))
heatmap.2(all.data,Rowv = FALSE, Colv = FALSE, trace="none",main="All data",col=colorRampPalette(c("green","yellow","red")))

然后再试一次,它不会生成热图并给我这个错误:

Error in .External.graphics(C_layout, num.rows, num.cols, mat, as.integer(num.figures),  : 
invalid graphics state
In addition: Warning messages:
1: In heatmap.2(all.data, Rowv = FALSE, Colv = FALSE, trace = "none", :
Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
2: In heatmap.2(all.data, Rowv = FALSE, Colv = FALSE, trace = "none", :
Discrepancy: Colv is FALSE, while dendrogram is `none'. Omitting column dendogram.

我也尝试添加功能键=T,但颜色键仍然没有出现在热图中,任何帮助将非常感激!

最佳答案

如果您的绘图过去一直有效,但现在抛出无效图形状态错误,请尝试通过调用dev.off()来重置图形设备。这是 RStudio 帮助网站建议的。

关于r - .External.graphics R 中的错​​误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18350353/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com