Skip to content

Instantly share code, notes, and snippets.

@digorithm
Created January 9, 2015 00:30
Show Gist options
  • Save digorithm/ba916354424fce30357d to your computer and use it in GitHub Desktop.
Save digorithm/ba916354424fce30357d to your computer and use it in GitHub Desktop.
public void addTrendLine(Plot2DPanel plot, boolean removePrev){
if (removePrev){
plot.removePlot(trendline);
}
double[] yEnd = new double[initial_data.x.length];
for (int i=0; i<initial_data.x.length; i++)
yEnd[i] = hypothesisFunction(initial_data.x[i]);
trendline = plot.addLinePlot("final", initial_data.x, yEnd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment