I am trying to create a pgf plot which includes (among others) a constant function f(x)=1. My x-axis should be restricted to some range (see below), and there is also a restriction on the y-axis. This is the minimal code that reproduces the issue:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,
xmax=.1,
ymin=0,
ymax=2]
\addplot {1};
\end{axis}
\end{tikzpicture}
\end{document}
This code produces the error
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 11.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 11.
! Dimension too large.
<recently read> \pgf@xx
l.11 \end{axis}
I can't work with sizes bigger than about 19 feet.
Continue and I'll use the largest value I can.
! Dimension too large.
The last seven lines of the error message repeat 5 times. This happens no matter what values I use for the ymin and ymax parameters, but only for certain xmin and xmax. From trying different values, my guess would be that xmin-xmax has to be greater than approximately 0.15 for LaTeX to compile this successfully, but in my use case it has to be a range from xmin=.0005 to xmax=.0027.
Why does LaTeX throw an error when the range is too small (or is there something else wrong with my code)?
~ $ pdflatex -version
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)

0:0.01because of the x values I was using. Is there a reason why LaTeX can draw this expression without being told a domain if the difference of the values ofxminandxmaxis large enough, but fails otherwise? – pascalhein Mar 07 '14 at 17:54expressionis implied in the absence of any other input type. – Paul Gessler Mar 07 '14 at 17:55\addplot [domain=0:1]{1};and\addplot expression[domain=0:1]{1};– cmhughes Mar 07 '14 at 18:07blackis applied in the case whereexpressionis left out. Is this documented? – Paul Gessler Mar 07 '14 at 18:12