For the following plot (with time axis) I would like to add a bold, red vertical line at index 2010-01-01.
But I always run into a Dimension too large error. How can I solve this issue?
Here is the code
\begin{tikzpicture}
\begin{axis}[
max space between ticks=25pt,
scale only axis=true,
every axis plot/.append style={very thick},
tick style={black, thick},
ylabel={},
ymax=700000,
%ymin=0,
grid=major,
enlarge x limits = false,
width=\textwidth,
height=0.5\textwidth,
xticklabel = {\year},
x tick label style={align=center},
date coordinates in=x,
table/col sep=comma,
date ZERO={1991-01-01},
xmin={1991-01-01},
xmax={2021-01-01},
xtick={1992-01-01, 1994-01-01, 1996-01-01, 1998-01-01, 2000-01-01, 2002-01-01, 2004-01-01, 2006-01-01, 2008-01-01, 2010-01-01, 2012-01-01, 2014-01-01, 2016-01-01, 2018-01-01, 2020-01-01},
xticklabels={1992, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014, 2016, 2018, 2020}
]
\addplot[black] table[x={month}, y={commits}, col sep=comma] {commits.csv};
\addplot[red, dashed] table[x={month}, y={0}, col sep=comma] {commits_growth.csv};
%\draw [red, dashed] ({2010-01-01}, 0) -- ({2010-01-01}, 700000); % causes 'Dimension too large' error
\end{axis}
\end{tikzpicture}

\documentclassto\end{document}, so it can be tested without modifications. – Torbjørn T. Nov 01 '21 at 16:04\pgfplotsset{compat=1.11}(or some higher version number) anywhere, by the way? – Torbjørn T. Nov 01 '21 at 16:11\documentclass{article}\usepackage{pgfplots}\pgfplotsset{compat=1.18}\usetikzlibrary{pgfplots.dateplot}\begin{document}... your code ...\end{document}compiles fine. – gernot Nov 01 '21 at 17:35compatsetting of 1.11 or higher, coordinates for\drawetc. inside anaxisenvironment are not assumed to be in the coordinate system of the axis. So 2010-01-01 is probably read as a normal numeric coordinate for thetikzpicture, not a date coordinate in the axis. Either add the mentionedcompatsetting, or useaxis csto explicitly use the axis coordinate system, e.g.(axis cs:{2010-01-01}, 0)instead of({2010-01-01}, 0). – Torbjørn T. Nov 01 '21 at 22:47