答案 0 :(得分:2)
将直方图保存为变量,然后将log10应用于bin计数。将-Inf值设置为0,然后绘制新计数。
# make histogram of the data
h <- hist(data)
# log10 the counts per histogram bin
h$counts <- log10(h$counts)
# set the -Inf values to 0
h$counts[!is.finite(h$counts)] <- 0
# plot the log10 counts
plot(h)