Discussion:
pgfplots: You have an axis with empty range
(too old to reply)
Leo
2009-11-06 16:59:44 UTC
Permalink
Hi there,

I am getting an error

! Package pgfplots Warning: You have an axis with empty range. Replacing
it with a default range and clearing all plots.

with this example:

\documentclass[11pt]{minimal}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}
[
legend columns=2,
xlabel={Power},
ytick={-1.07918,-0.95424,-0.77815,-0.47712},
yticklabels={$10^{-12}$,$10^{-9}$,$10^{-6}$,$10^{-3}$},
major y grid style={black,dashed},
ymin=-1.1,
xmin=-21, % The problem goes way if this line is removed.
ymax=-0.46,
ymajorgrids,
width=10cm,
height=7cm
]

\addplot+[only marks,mark=*,mark size=2pt] coordinates {
(-27.2040816327,-0.65630552381)
(-26.2040816327,-0.735146714286)
(-25.2040816327,-0.813987904762)
(-24.1836734694,-0.903580166667)
(-23.2040816327,-0.982421357143)
};
\end{axis}
\end{tikzpicture}
\end{document}

However, if I remove xmin=-21, the problems goes away. Is this a bug in
pgfplots? How to fix it if I have to set xmin and xmax? I'm using
pgfplots from CVS 2009-10-20ish. Thank you.

Leo
--
Emacs uptime: 45 days, 8 hours, 10 minutes, 54 seconds
Joseph Wright
2009-11-06 17:59:37 UTC
Permalink
Post by Leo
Hi there,
I am getting an error
  ! Package pgfplots Warning: You have an axis with empty range. Replacing
  it with a default range and clearing all plots.
\documentclass[11pt]{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
  \begin{axis}
    [
    legend columns=2,
    xlabel={Power},
    ytick={-1.07918,-0.95424,-0.77815,-0.47712},
    yticklabels={$10^{-12}$,$10^{-9}$,$10^{-6}$,$10^{-3}$},
    major y grid style={black,dashed},
    ymin=-1.1,
    xmin=-21, % The problem goes way if this line is removed.
    ymax=-0.46,
    ymajorgrids,
    width=10cm,
    height=7cm
    ]
    \addplot+[only marks,mark=*,mark size=2pt] coordinates {
      (-27.2040816327,-0.65630552381)
      (-26.2040816327,-0.735146714286)
      (-25.2040816327,-0.813987904762)
      (-24.1836734694,-0.903580166667)
      (-23.2040816327,-0.982421357143)
    };
  \end{axis}
\end{tikzpicture}
\end{document}
However, if I remove xmin=-21, the problems goes away. Is this a bug in
pgfplots? How to fix it if I have to set xmin and xmax? I'm using
pgfplots from CVS 2009-10-20ish. Thank you.
Leo
--
Emacs uptime: 45 days, 8 hours, 10 minutes, 54 seconds
Your xmin is bigger than the *largest* x value you have
(-23.2040816327). You need an xmin less than that, and I'd think less
than -27.2040816327.
--
Joseph Wright
Leo
2009-11-06 18:04:21 UTC
Permalink
Post by Joseph Wright
Your xmin is bigger than the *largest* x value you have
(-23.2040816327). You need an xmin less than that, and I'd think less
than -27.2040816327.
It seems my brain was not working. Thank you for spotting this mistake.

Best wishes,

Leo

Loading...