Code: Select all
\documentclass[10pt,a4paper]{report}
\usepackage{pgfplots,pgfplotstable}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
legend image post style={},
ylabel=Apparent density{,} $g\,cm^{-3}$,
xlabel=Schopper-Riegler drainability{,} \emph{SR},
legend entries={Reference, NaOH},
legend style={
at={(0.97,0.35)},
cells={anchor=west}
}
]
\addplot [only marks] table [x=X,y=Y]{data/chap4/RF_wetness_density.dat};
\addplot [no markers, forget plot] table [x=X,y={create col/linear regression={y=Y}}]{data/chap4/RF_wetness_density.dat};
\addplot [only marks, mark=square*] table [x=X,y=Y]{data/chap4/SH_wetness_density.dat};
\addplot [no markers, forget plot] table [x=X,y={create col/linear regression={y=Y}}]{data/chap4/SH_wetness_density.dat};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
The file "RF_wetness_density.dat"
Code: Select all
X Y
21 0.34
42 0.41
65 0.47
78 0.50
82 0.54
Code: Select all
X Y
11 0.31
23 0.38
30 0.43
54 0.49
68 0.52