How could I add a trend line to this plot? Many thanks!
\begin{tikzpicture}
\begin{axis}[
date coordinates in=x,
xtick=data,
xticklabel style=
{rotate=90,anchor=near xticklabel},
xticklabel=\day. \hour:\minute,
date ZERO=2009-08-18,% <- improves precision!
]
\addplot coordinates {
(2009-08-18 09:00, 050)
(2009-08-18 12:00, 100)
(2009-08-18 15:00, 100)
(2009-08-18 18:35, 100)
(2009-08-18 21:30, 040)
(2009-08-19, 020)
(2009-08-19 3:00, 000)
(2009-08-19 6:0, 035)
};
\end{axis}
\end{tikzpicture}
\addplotcommand. – JamesNZ Oct 29 '15 at 02:39pgfplotsat present has only linear regression. So you have to find the equation yourself. And then plot that also. – Oct 29 '15 at 02:49