mas wrote:Just add another addplot command:1. How to modify the code above to add a linear regression line, with options for its style (color and thickness)?Code: Select all
\addplot+[no marks,red, thick] {1.2304 * x + 0.5121 } ;
The usual tikz node command should do the trick.2. How to show its equation (with many digits)? and to change its "X" and "Y" symbols? (so the equation is using exactly the same symbols as on the axis).Code: Select all
\node at (1.5,0) {$Y=1.2304 X + 0.5121} ;
Graphics, Figures & Tables ⇒ pgfplots : How to add a linear regression line?
pgfplots : How to add a linear regression line?
NEW: TikZ book now 40% off at Amazon.com for a short time.
