Adding a line of best fit to a 3D scatter plot in MATLAB or Gnuplot

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 7K views
Crabman
Messages
2
Reaction score
0
Hi all,

I'm having problems with something I'd like to do.

Basically I have a 3D scatter plot and would like to add a line of best fit to it, I've googled this but most of the answers I get are incomprehensible to me (I'm a chemistry PhD student and my maths isn't amazing).

Does anyone know a program or a method for doing this? The easier the better! (I have access to GUNplot and MATLAB if that helps but am not that familiar with either)

Many thanks in advance.
 
Physics news on Phys.org
You'd probably find something like excel spreadsheet the most accessible.

Use the "LinEst" function (should be listed under "statistical functions").

Hint. Highlight two cells in adjacent columns before selecting "LinEst" and also hold both "ctrl" and "shift" when you click the final ok (needed to make a function return two values, gradient and y-intercept in this case).
 
Crabman said:
Hi all,

I'm having problems with something I'd like to do.

Basically I have a 3D scatter plot and would like to add a line of best fit to it, I've googled this but most of the answers I get are incomprehensible to me (I'm a chemistry PhD student and my maths isn't amazing).

Does anyone know a program or a method for doing this? The easier the better! (I have access to GUNplot and MATLAB if that helps but am not that familiar with either)

Many thanks in advance.

Maybe you have already found this:

http://mathforum.org/library/drmath/view/69103.html

Or maybe not. :smile: