R-密度图错误消息“缺少值”

时间:2019-08-29 15:17:26

标签: r plot density-plot frequency-distribution

enter image description here我正在尝试创建多个海拔数据的组合密度和频率图。它始终是一个盆地(Lake_DF1 [[6]])和一个相应的缓冲区(Buffer_DF1 [[6]])。这些图应包括盆地和缓冲区高程频率的条形以及盆地和缓冲区高程密度的线。 Lake_DF1 [[6]]和Buffer_DF1 [[6]]是转换为data.files的大列表。

`hist(Lake_DF1[[6]], col = rgb(0,0,1,0.5),border = "black", prob = TRUE, 
# show densities instead of frequencies
breaks = 60, xlim = c(14,17), xlab = "temp", main = "DTLB 6")
lines(density(Lake_DF1[[6]]), lwd = 2, col = "chocolate3")
hist(Buffer_DF1[[6]], col = rgb(1,0,0,0.5),border = "black", prob = TRUE,
breaks = 60, xlim = c(14,17), xlab = "temp", add=TRUE)
lines(density(Buffer_DF1[[6]]), lwd = 2, col = "chocolate3")`

错误: 1)绘图的y轴未显示0到1,而是显示0到4(对于另一个绘图,它甚至显示为0到7) 2)缓冲区的密度发生错误,它包含缺少的值。这以前没有发生过,我也不知道为什么会发生。将代码omit.na添加到错误消息所在的行后,该代码`hist(Lake_DF1[[6]], col = rgb(0,0,1,0.5),border = "black", prob = TRUE, + breaks = 60, xlim = c(14,17), xlab = "temp", main = "DTLB 6") lines(density(Lake_DF1[[6]]), lwd = 2, col = "chocolate3") hist(Buffer_DF1[[6]], col = rgb(1,0,0,0.5),border = "black", prob = TRUE, + breaks = 60, xlim = c(14,17), xlab = "temp", add=TRUE) lines(density(Buffer_DF1[[6]]), lwd = 2, col = "chocolate3") Error in density.default(Buffer_DF1[[6]]) : 'x' contains missing values` 不起作用。

.....
self.model.save(filepath, overwrite=True)
.....
TypeError: ('Not JSON Serializable:', b'\n\x15clip_by_value/Minimum\x12\x07Minimum\x1a\x12conv2d_23/Identity\x1a\x17clip_by_value/Minimum/y*\x07\n\x01T\x12\x020\x01')

0 个答案:

没有答案