Closed muzimuzhi closed 4 months ago
The last example of /pgfplots/contour lua
has a similar problem.
% !TeX program = lualatex
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.18}
\begin{document}
% Preamble: \pgfplotsset{width=7cm,compat=1.18}
\begin{tikzpicture}
\begin{axis}
\addplot3 [
surf,
shader=interp
] coordinates {
(0,0,0) (1,0,0) (2,0,0) (3,0,0)
(0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5)
(0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5)
};
\addplot3 [
contour lua,
z filter/.code={\def\pgfmathresult{1}},
] coordinates {
(0,0,0) (1,0,0) (2,0,0) (3,0,0)
(0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5)
(0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5)
};
\end{axis}
\end{tikzpicture}
\end{document}
There must be some PDF trickery going on with all these examples. Apple's Preview app shows an empty plot:
and the Chrome browser's PDF viewer shows the same thing as in the HTML version's image:
and evidently so does pdftocairo
which is doing the conversion to SVG and PNG. Not sure what to do about it and whether there exist any easily command line callable viewers that do it "correctly" -- I don't think Adobe Acrobat will be very helpful.
EDIT: ImageMagick does it correctly.
MuPDF does it correctly too. mutool convert -o output.png input.pdf
doc: https://mupdf.readthedocs.io/en/latest/mutool-convert.html
I can confirm this issue and the similar #30 and #31 are all fixed in "HTML version last updated: 2024-02-26". Thank you.
Describe the bug
In the first example of
/pgfplots/mesh/color input
, the main plot uses a colormap different from the colorbar next to it, hence different from that in the PDF manual.Screenshots
I can get the colormap in PDF with