Open maxchendt opened 7 months ago
Some caches set globally are not reset. Try this patch to \pgfplotspoint@initialisation
\documentclass[tikz,margin=5pt]{standalone}
\usepackage{tikz,xcolor, pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{xpatch}
\makeatletter
% cache@2v2 and friends are not initialized in \pgfplotspoint@initialisation
\xapptocmd\pgfplotspoint@initialisation{%
% other z-axis variables are initialised unconditionally too
% \ifpgfplots@threedim
\pgfplotspoint@initialise@axis@cache02%
\pgfplotspoint@initialise@axis@cache12%
\pgfplotspoint@initialise@axis@cache22%
\pgfplotspoint@initialise@axis@cache20%
\pgfplotspoint@initialise@axis@cache21%
% \fi
}{}{\PatchFailed}
\def\pgfplotspoint@initialise@axis@cache#1#2{%
\global\expandafter\let\csname pgfplotspointouternormalvectorofaxis@cache@v#1#2\endcsname\relax
\global\expandafter\let\csname pgfplotspointouternormalvectorofaxis@cache@#1v#2\endcsname\relax
\global\expandafter\let\csname pgfplotspointouternormalvectorofaxis@cache@#1#2v\endcsname\relax
}
\makeatother
\begin{document}
%https://tex.stackexchange.com/q/139686 Controlling Orientation in 3D PGF Plots
\begin{tikzpicture}
\begin{axis}[
xlabel={$x$}, ylabel={$y$}, zlabel={$z$},
x={(-0.3cm,-0.3cm)}, y={(.5cm,0.0cm)}, z={(0cm,.1cm)},
axis lines=middle, axis on top,
xtick={-2,2}, ytick={-2,2},ztick={16,32},
enlargelimits=true
]
\addplot3[surf, thick, color=green, domain=-4:4] {x^2+y^2};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
xlabel={$x$}, ylabel={$y$}, zlabel={$z$},
x={(1cm,0cm)}, y={(0.317cm,0.217cm)}, z={(0cm,0.17cm)},
axis lines=middle, axis on top,
%https://tex.stackexchange.com/q/410445 Warning: The ticklabel anchor cannot be determined, the normal vector and the unit x vector are almost parallel
xtick={-2,2}, ytick={-2,2},ztick={16,32},
enlargelimits=true
]
\addplot3[surf, thick, color=green, domain=-4:4] {x^2+y^2};
\end{axis}
\end{tikzpicture}
\end{document}
If I comment out any one of the
tikzpicture
, there is no warning. This Warning has been seen in https://tex.stackexchange.com/q/410445compiling outputs