I'like to add an vertical line with some text in a graphic, but i've not found the way.
I tried something like
\addplot coordinates { (2008-01-01,0) (2008-01-01,130)} node {some text};
but it didnt work and i'm stuck
Here is a working minimal example, that creates first the ybar stacked
\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\begin{document}
\pgfplotstableread[col sep=comma,header=true]{
Year,1,1.1,1.2,1.3,1.4
2005,0,0.29,21.97,42.22,27.98
2006,0,1.43,8.25,47.53,29.96
2007,0.05,0.05,13.62,45.26,34.05
2008,0.06,0.89,10.63,30.84,44.63
2009,0.09,0,7.71,30.82,46.75
2010,0,0,1.65,28.34,27.02
2011,0,0,0.94,29.02,7.64
}\data
\begin{tikzpicture}
\begin{axis}[
stack plots=y,
area style,
enlarge x limits=false,
enlarge y limits=upper,
x tick label style={/pgf/number format/1000 sep=},
ymax=150
]
\addplot table [x=Year, y=1] {\data} \closedcycle;
\addplot table [x=Year, y=1.1] {\data} \closedcycle;
\addplot table [x=Year, y=1.2] {\data} \closedcycle;
\addplot table [x=Year, y=1.3] {\data} \closedcycle;
\addplot table [x=Year, y=1.4] {\data} \closedcycle;
\end{axis}
\end{tikzpicture}
\end{document}
dateplot
library (you're loading, but not using the latter). You're basically asking: How can I add a vertical line and a text label to a PGFPlots plot, right?\node [coordinate, pin=above:{Some text}] at (axis cs:2008,130) {};
could be of help. pgfplots gives you the possibility to add nodes relatively to a coordinate system (cs) axis.