Please have a look at the following MWE:
\documentclass{article}
\usepackage{pgfplots,pgfplotstable}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
%ymode=log,
]
\addplot coordinates {
(0, 6.887e-02)
(0.5, 3.177e-02)
(1, 1.341e-02)
(1.5, 5.334e-03)
(2, 2.027e-03)
(2.5, 7.415e-04)
(3, 2.628e-04)
(3.5, 9.063e-05)
(4, 3.053e-05)
};
\draw (axis cs:1.2,\pgfkeysvalueof{/pgfplots/ymin}) -- (axis cs:1.2,\pgfkeysvalueof{/pgfplots/ymax});
\end{axis}
\end{tikzpicture}
\end{document}
It produces a graph like this (some data with a vertical line at x=1.2):

As soon as I uncomment ymode=log, the vertical line disappears. Bummer!

\pgfmathparse{pow(10,\pgfkeysvalueof{/pgfplots/ymax})}work to get back the original value. – percusse May 22 '12 at 13:05\pgfplotsextra{ \pgfmathsetmacro\ymin{exp(\pgfkeysvalueof{/pgfplots/ymin})} \pgfmathsetmacro\ymax{exp(\pgfkeysvalueof{/pgfplots/ymax})} \draw (axis cs:1.2,\ymin) -- (axis cs:1.2,\ymax); }, but there seems to be a numerical error (the line doesn't go all the way to the bottom), and it's a bit too labour intensive for my liking. – Jake May 22 '12 at 14:05yminlogandymaxlogkeys to get it running forsemilogyaxisenvironment etc. – percusse May 22 '12 at 14:24/pgf/fpu) would solve the issue. Keep in mind that\pgfmathsetmacrowill always assign the result to some TeX register (for whatever reason). Thus,/pgf/fpu+\pgfmathparse{...}\let\ymin=\pgfmathresultwould fix your code snippet. – Christian Feuersänger May 22 '12 at 20:16