我对使用barplot函数有疑问,我有以下函数接收data.frame作为参数,其行数可以有很大差异。我想将直方图打印为图像或相似度。问题是我总是遇到barplot边距问题。有没有办法用另一个没有问题边距的库做同样的直方图?
功能:
HIST_EPC_list<-function(DF_TAG_PHASE_EPC_counter){
num<-nrow(DF_TAG_PHASE_EPC_counter)
barplot(DF_TAG_PHASE_EPC_counter$Num_EPC, names.arg = DF_TAG_PHASE_EPC_counter$Tag_PHASE, xlab = "Tag_PHASE", ylab = "Num_EPC", main="Histograma Num tags/PHASE:", width=40)
par(mar=c(10,10,10,10))
}
data.frame示例: DF_TAG_PHASE_EPC_counter
Tag_PHASE Num_EPC
1 123.0 1
2 75.0 1
3 78.0 1
4 81.0 2
5 84.0 1
6 87.0 1
7 90.0 2
8 98.0 1
错误:
Error in plot.new() : figure margins too large
Called from: barplot(DF_TAG_RSSI_EPC_counter$Num_EPC, names.arg = DF_TAG_RSSI_EPC_counter$Tag_RSSI,
xlab = "Tag_RSSI", ylab = "Num_EPC", main = "Histograma Num tags/RSSI:",
width = 10)