Skip to main content
formatting, capitalization, tags etc
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k

Basically, imI'm just trying to plot a curve over my histogram for the weight of a few students.

lines(density(weight),lwd = 2,

  • col = "red")
 lines(density(weight), lwd = 2, col = "red")

However, what iI get is a line on the bottom of the graph. I suppose the density has to be such that the integral of the curve is 1. What command should iI be using instead of density, if iI want to have a fitting curve for the histogram?

Basically, im just trying to plot a curve over my histogram for the weight of a few students.

lines(density(weight),lwd = 2,

  • col = "red")

However, what i get is a line on the bottom of the graph. I suppose the density has to be such that the integral of the curve is 1. What command should i be using instead of density, if i want to have a fitting curve for the histogram?

Basically, I'm just trying to plot a curve over my histogram for the weight of a few students.

 lines(density(weight), lwd = 2, col = "red")

However, what I get is a line on the bottom of the graph. I suppose the density has to be such that the integral of the curve is 1. What command should I be using instead of density, if I want to have a fitting curve for the histogram?

Source Link
Qwertford
  • 295
  • 3
  • 9

Why is my density plot just a line on the bottom?

Basically, im just trying to plot a curve over my histogram for the weight of a few students.

lines(density(weight),lwd = 2,

  • col = "red")

However, what i get is a line on the bottom of the graph. I suppose the density has to be such that the integral of the curve is 1. What command should i be using instead of density, if i want to have a fitting curve for the histogram?