Tikz 圆圈分为四个象限

Tikz 圆圈分为四个象限

我正在尝试创建一个圆,用虚线“十字”将其分成四个象限,其中顶部切片略小于底部切片。我想用标签abcd(位于象限中心)标记四个象限,并标记顶部和底部切片。

这是我的第一次尝试:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\draw[dashed] (-2,1) -- (2,1);
\draw[dashed] (0,2) -- (0,-2);
\draw (0,1.5) node{Top Piece};
\draw (0,-0.5) node{Bottom Piece};
\draw (-1,1.5) node{$a$};
\draw (1,1.5) node{$b$};
\draw (-1,-0.5) node{$c$};
\draw (1,-0.5) node{$d$};
\end{tikzpicture}
\end{figure}
\end{document}

但它至少存在一些问题:

  1. 它基于坐标,这意味着它不能缩放。如果我想让我的圆变大(我认为变大是个好主意),我必须重新绘制所有的线、节点和标签以适应新的圆;
  2. 线条和圆并不完全相交,只是近似相交,这可能是#1 的结果;
  3. 垂直虚线穿过标签“顶部件”和“底部件”。

我应该用不同的方式创建这个圆圈吗?请原谅我对 Tikz 的了解还很浅薄。感谢您的帮助!

答案1

文本无法缩放,因此在缩放图片时文本可能会重叠。一种可能的解决方案是将文本atop piecesb合并到一个节点中。带有的节点fill将隐藏虚线:

\documentclass{article}
    \usepackage{tikz}

\usepackage[active,floats,tightpage]{preview}%for showing just a picture
    \setlength\PreviewBorder{1em}

    \begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[scale=1,
every node/.style = {inner xsep=0mm, inner ysep=1mm, fill=white}
                    ]
\draw (0,0) circle (2cm);
\draw[densely dashed]   
    (150:2) -- (30:2)       (270:2) -- (90:2);
\draw (0,1.4) node[fill=white]{a Top Piece b};
\draw (0,-0.5) node[fill=white]{c\quad Bottom Piece\quad d};
\end{tikzpicture}
\end{figure}
    \end{document}

在此处输入图片描述

scale=2可以获得缩放的图片,但节点的大小保持不变。

在此处输入图片描述

相关内容