如何添加围绕圆环缠绕的环路以及向该圆环添加简单环路:
\documentclass[tikz,border=1.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[colormap/blackwhite,
view={30}{60},axis lines=none
]
\addplot3[surf,opacity=0.7,
samples=50, point meta=x+3*z*z-0.25*y,
domain=0:2*pi,y domain=0:2*pi,
z buffer=sort]
({(3+cos(deg(x)))*cos(deg(y))},
{(3+cos(deg(x)))*sin(deg(y))},
{sin(deg(x))});
\end{axis}
\end{tikzpicture}
\end{document}
答案1
像这样:
代码:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \r in {5,4.99,...,3}{%
\pgfmathsetmacro{\c}{int(20*\r)}
\draw[blue!\c] (0,0) circle(\r);
}
\foreach \an in {0,15,...,345}
\draw (\an:4) circle(1.5);
\end{tikzpicture}
\end{document}
编辑以回答 OP 评论:
你可以拥有这个:
几乎没有变化:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \r in {5,4.99,...,3}{%
\pgfmathsetmacro{\c}{int(20*\r)}
\draw[gray!\c] (0,0) circle(\r);
}
\foreach \an in {0,10,...,350}
\draw[line width=2pt] (\an:4) circle(1);
\end{tikzpicture}
\end{document}