我无法立即在直方图中看到这条线

问题描述

我有一个小问题。

用直线绘制直方图时,该直线不会立即显示。我必须将其绘制2次,然后切换回第一个图以查看实际线条。

hist(df$column,col = "lightgreen",main = "The BMI of the players",xlab = "BMI",ylab = "Amount of players",xlim=c(20,30),breaks = 20,freq=FALSE) # close hist
lines(density(df$column),col="blue",lwd=2)) # lines is a different command

因此,运行代码并查看:

Histogram without a line

第二次运行后,我得到了相同的图。但是,当我单击箭头查看以前的绘图时,我首先看到了想要的绘图(带有线条的绘图!)

Histogram with a line

有人知道我如何立即获得线的直方图

非常感谢您!

解决方法

如果在对Maybe的调用中对char* p[2]= {"*","!myFile.dat"}; checkout_opts.paths.strings = p; checkout_opts.paths.count = 2; 进行了调用,则lines将作图,而hist将在前一个图上添加一行,因为它们被同时调用。

尝试:

hist

将其直接显示在情节上

,

  hist(df$column,col = "lightgreen",main = "The BMI of the players",xlab = "BMI",ylab = "Amount of players",xlim=c(20,30),breaks = 20,freq=FALSE) # close hist
  lines(density(df$column),col="blue",lwd=2)) # lines is a different command

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...