我正在通过包创建图片tikz
。它在两个不同的帧上显示了一个八辐马车轮。我如何添加图例 __ 帧 1 和 ....帧 2?当我尝试使用\addlegendentry
它时,它给我一个错误。提前致谢
\documentclass[10pt,a4paper]{report}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=3]
\draw (0,0) circle (1cm);
\draw (0:1cm) -- (180:1cm);
\draw (45:1cm) -- (225:1cm);
\draw (90:1cm) -- (270:1cm);
\draw (135:1cm) -- (315:1cm);
\draw[dotted] (7.5:1cm) -- (187.5:1cm);
\draw[dotted] (52.5:1cm) -- (232.5:1cm);
\draw[dotted] (97.5:1cm) -- (277.5:1cm);
\draw[dotted] (142.5:1cm) -- (322.5:1cm);
\end{tikzpicture}
\end{document}
答案1
像这样?
您的问题不是很清楚,所以这只能作为起点...给出上图的 MWE 是:
\documentclass[10pt,a4paper]{report}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[scale=3]
\node (n1) [circle,draw,minimum size=6cm] {};% node size can not be scaled
\node (n2) [draw,right=of n1,align=left] {- - - frame 1 \dots\\
-----frame 2 \dots};
\draw ( 0:1) -- (180:1)
( 45:1) -- (225:1)
( 90:1) -- (270:1)
(135:1) -- (315:1);
\draw[dotted]
( 7.5:1) -- (187.5:1)
( 52.5:1) -- (232.5:1)
( 97.5:1) -- (277.5:1)
(142.5:1) -- (322.5:1);
\end{tikzpicture}
\end{document}