I have a scatter graph drawn using pgfplots
from here, I have added a linear regression line using pgfplotstable
.
As you can see, there appears to be one statistically significant outlier (more than 2 standard deviations away from the line of best fit) at about (2.5e-3,5.8).
How would I go about circling this, or otherwise indicating that it is an outlier, on my graph?
Ideally, I'd like pgfplotstable
to calculate the standard deviation of the linear regression and then check to see if each point is an outlier individually. However, if this cannot be done, how would I got about manually circling, or changing the symbol used on, that one point?
Edit: MWE:
\documentclass{article}
\usepackage{filecontents}
\usepackage{tikz,pgfplots}
\usepackage{pgfplotstable}
\begin{filecontents}{GraphData.txt}
lnPa 1/T
6.5723 0.002304
6.7214 0.002273
6.7178 0.002273
6.7117 0.002278
6.7178 0.002278
6.6783 0.002283
6.6490 0.002288
6.6254 0.002294
6.6026 0.002299
6.5820 0.002304
6.5539 0.002309
6.4907 0.002320
6.4281 0.002331
6.3509 0.002347
6.2823 0.002364
6.2066 0.002381
6.1312 0.002381
6.0707 0.002404
6.0113 0.002421
5.8861 0.002445
5.8141 0.002506
5.7236 0.002475
5.6490 0.002494
5.5759 0.002506
5.5134 0.002519
5.3660 0.002545
5.2679 0.002571
5.1761 0.002584
5.0876 0.002597
5.0239 0.002611
4.9628 0.002625
4.8283 0.002646
4.7791 0.002660
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}[legend pos=north east,anchor=west, xlabel={$T^{-1}/ K^{-1}$}, ylabel={$\ln P*_a$}]
\addplot table [only marks, x={1/T},y={lnPa}]{GraphData.txt};
\addplot [thick, red] table[x={1/T},
y={create col/linear regression={y={lnPa}}}
] % compute a linear regression from the input table
{GraphData.txt};
%\addlegendentry{$\dfrac{dy}{dx} = \pgfplotstableregressiona$}
%\addlegendentry{$y_{intercept} = \pgfplotstableregressionb$}
\end{axis}
\end{tikzpicture}
\end{document}
\draw (<x>,<y>) circle [radius=0.5];
\documentclass
and ending with\end{document}
. - percusse hint (manually circling) should work well.addplots
... but you can run it now. If (s)he want he can edit later.