Closed egeerardyn closed 9 years ago
The problem is caused by the z buffer = sort
introduced in 027dfd22ac2760cafa215bac794b1e623646bcd9
This MWE will error (and after removing the z buffer, it will compile but with wrong coloring):
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={-37.5}{30},z buffer=sort]
\addplot3[surf, draw=black, mesh/rows=2]
table[row sep=crcr,header=false,point meta=\thisrowno{2}] {%
%
1 1 2\\
1 2 1.715921\\
1 3 1\\
1 4 1.793604\\
1 5 2.236068\\
1 6 2\\
1 7 1\\
1 8 2.557537\\
1 9 4.236068\\
1 10 5.520147\\
};
\addlegendentry{legendary};
\end{axis}
\end{tikzpicture}%
\end{document}
I read in the pgfplots manual that z buffer = sort
might fail. I wonder if the error produced by the above MWE is the failure that the manual talks about (maybe
@cfeuersaenger can confirm).
This is a bug in pgfplots.
It happens because the small mesh drawn into the legend does not seem to support 'z buffer=sort'.
A workaround is to add
legend image post style={/pgfplots/z buffer=default}
I will have fixed this for pgfplots 1.12 (which will become the next stable within the next weeks).
Thanks for the report.
Kind regards
Christian
Am 04.01.2015 15:35, schrieb Oleg Komarov:
I read in the pgfplots manual that |z buffer = sort| might fail. I wonder if the error produced by the above MWE is the failure that the manual talks about (maybe @cfeuersaenger https://github.com/cfeuersaenger can confirm).
— Reply to this email directly or view it on GitHub https://github.com/matlab2tikz/matlab2tikz/issues/504#issuecomment-68634808.
@cfeuersaenger Thanks for confirming this.
This means we can either add that work-around to our legend generation code and/or when 1.12 is released have that version marked as required from our part when we enforce z-sorting. The latter should be our long-term solution, anyhow, but the other could help in the meanwhile for our developers.
I reckon we should go with your suggestion @egeerardyn. First the workaround then use 1.12.
Let's add legend image post style={/pgfplots/z buffer=default},
as a workaround for now. It probably will take some time after the release of pgfplots 1.12 until it is widely adopted.
@egeerardyn, is this something for the version 1.0 release milestone or do we want to stick to requiring pgfplots 1.12, which is by now released?
@PeterPablo We might as well recommend pgfplots 1.12 for z-sorting. No need for a work-around on our side any more, I'd say.
Fine by me. Searching the internet for the error message directly leads here. Let me post a command for Linux that updates the current user's pgfplots to the newest available release:
cd ~/texmf; wget http://mirrors.ctan.org/install/graphics/pgf/contrib/pgfplots.tds.zip; unzip pgfplots.tds.zip; texhash ~/texmf; rm pgfplots.tds.zip
I am closing here, since a workaround exists for pgfplots <= 1.11 and the problem is fixed by pgfplots 1.12 which is by now publicly available on CTAN.org.
We should add this into the code as well, so we shouldn't close yet.
When double-checking current feature branches, I noticed that
ACID(58)
in MATLAB R2014a produces output that cannot be compiled by a LaTeX compiler by our latest develop branch (i.e. 285dc83 )In the error log, one of the symptoms is:
I haven't inspected this further, this issue report is just to make sure we do not forget this.