\documentclass{article} % lualatex
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view={0}{90},
samples=40,
domain=-3:3,
axis equal=true,
]
\addplot3 [contour lua={levels={1,1.5,2},labels=false}] {x^2+y^2};
\end{axis}
\end{tikzpicture}
\end{document}
我想把三个圆圈全部变成黑色(现在,它们是红色、黄色、蓝色),但是\addplot3 [black, contour lua={levels={1,1.5,2},labels=false}] {x^2+y^2};
不行。
答案1
\documentclass{article} % lualatex
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view={0}{90},
samples=40,
domain=-3:3,
axis equal=true,
]
\addplot3 [contour lua={levels={1,1.5,2},labels=false,draw color=black}] {x^2+y^2};
\end{axis}
\end{tikzpicture}
\end{document}