I'm trying to plot data with a logarithmic y-axis and restricting the y-data to a specified domain, but compilation fails for a reason I don't understand. This is the code:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}%
\begin{tikzpicture}
\begin{axis}[ymode=log, restrict y to domain=1:6]
\addplot coordinates {(0, 1.1e1) (1, 1.7e3) (2, 0.0e0) (2, 3.4e7) (4, 8.1e5)};
\end{axis}
\end{tikzpicture}
\end{document}
Running it results in an error message:
! Missing number, treated as zero.
<to be read again>
i
l.6 ..., 1.7e3) (2, 0.0e0) (2, 3.4e7) (4, 8.1e5)};
According to the pgfplots
manual for version 1.5.1 (29 December 2011), page 272 (about restrict x/y/z to domain), For logarithmic axes, min and max are logs of the respective values. If I disable either the logarithmic y-axis or the domain-restriction, the code runs successfully and output is as expected (but not as desired).
Software versions:
pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) (format=pdflatex 2012.5.30)
pgfplots 2011/12/29 v1.5.1 (git show 1.5.1-4-g53e640f )
tikz 2010/10/13 v2.10 (rcs-revision 1.76)
.
What's going on? What am I doing wrong? Or is this a bug?
Best Answer
This is not a direct answer however it might help to get what you want to do. I also don't know why it doesn't work.
If you remove the
unbounded coords=discard
it is set tojump
.