LaTeX forum ⇒ Graphics, Figures & Tablespgfplots : How to add a linear regression line? Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Posts: 1
Joined: Wed May 16, 2018 4:28 pm

pgfplots : How to add a linear regression line?

Postby Masruk » Wed May 16, 2018 4:38 pm

mas wrote:
1. How to modify the code above to add a linear regression line, with options for its style (color and thickness)?

Just add another addplot command:
  1. \addplot+[no marks,red, thick] {1.2304 * x + 0.5121 } ;

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).

The usual tikz node command should do the trick.
  1. \node at (1.5,0) {$Y=1.2304 X + 0.5121} ;

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Baidu [Spider] and 13 guests