0

The following MWE works great with pgfplots v1.11, but gives a warning about an empty y axis range with v1.12. I didn't see anything in the README that would indicate a change has been made to the xbar style. How can I fix this and restore the 1.11 behavior (without setting compat=1.11)?

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
    xbar,
    xmin=-60, xmax=80,
    axis y line*=middle,
]
\addplot[blue,fill,draw=none] table[x={750-K}, y expr=\coordindex] {
 750-K
 62.099
 62.046
 56.304
-44.258
-28.826
 18.740
-14.653
 14.402
-12.907
 12.295
 };
 \end{axis}
 \end{tikzpicture}
 \end{document}

Output from compat=1.11: v1.11

Output from compat=1.12: v1.12

5
  • I'm unable to duplicate this. I get your result for compat=1.11 regardless of whether I use compat=1.11 or compat=1.12.
    – erik
    Commented Feb 11, 2015 at 23:10
  • @erik Thanks for checking! I'll check on another computer in the morning :)
    – darthbith
    Commented Feb 12, 2015 at 3:41
  • Does it make a difference if you run it with lualatex? The main change in 1.12 is that pgfplots makes intensive use of lua. Commented Feb 12, 2015 at 22:39
  • @ChristianFeuersänger lualatex doesn't fix the problem...
    – darthbith
    Commented Feb 12, 2015 at 22:44
  • 4
    I'm voting to close this question as off-topic because it is about a fixed bug in pgfplots.
    – darthbith
    Commented Mar 11, 2015 at 23:29

2 Answers 2

3

The problem appears if and only if you use lualatex. Apparently, the new lua backend fails with this plot type.

Possible (alternative) Workarounds are

  1. use \pgfplotsset{compat=1.11} or

  2. use \pgfplotsset{compat=1.12, lua backend=false} or

  3. add lua backend=false to the offending plot or

  4. use pdflatex to compile your document.

I will take care of the bug.

1
1

As mentioned by erik in a comment, this problem may not be reproducible. In fact, I cannot reproduce it myself by copying the code out of the question. Nonetheless, my original file still has this problem. I am able to resolve the issue by adding point meta=explicit symbolic into the axis options:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
    xbar,
    xmin=-60, xmax=80,
    axis y line*=middle,
    point meta=explicit symbolic,
]
\addplot[blue,fill,draw=none] table[x index={0}, y expr=\coordindex] {%
 750-K
 75
 62.046
 56.304
-44.258
-28.826
 18.740
-14.653
 14.402
-12.907
 12.295
 };
 \end{axis}
 \end{tikzpicture}
 \end{document}

Not the answer you're looking for? Browse other questions tagged .