1

I'm using Flot to plot a horizontal line in a linear regression application, the points I entered was (1,1) (2,1) (3,1) (4,1) and for the regression line, I'm only plotting 2 points, the Y intercept at (1,1) and the last point at (4,1). I have autoscale ON, for some reason flot doesn't plot (1,1) but rather (1,0.99999999) instead? My regression line is on top of the X-axis and the Y intercept says 0.999999, while the points are on top of the graph. I want the plot to show a horizontal line across a Y-axis scale from 0 to 2, how do I do that?

My regression line is plotted as follows:

this.regLine.push([this.min, this.theta[0] + this.theta[1] * norm_x1]);
this.regLine.push([this.max, this.theta[0] + this.theta[1] * norm_x2]);
Dewei Chen
  • 21
  • 1
  • 2

0 Answers0