\begin{tikzpicture}[fill=gray]
\scope
\clip (2.7,-2.54) rectangle (-1.5,1.5)
(0,0) circle (1)
(1.2,0) circle (1);
\fill (0.6,-1.04) circle (1);
\endscope
\draw (0,0) circle (1) (0,1) node [text=black,above] {$A$}
(1.2,0) circle (1) (0,1) node [text=black,above right,shift={(1,0.01)}] {$B$}
(0.6,-1.04) circle (1) (1.1,-0.6) node [text=black, shift={(0.6,-1.1)}] {$C$}
(2.7,-2.54) rectangle (-1.5,1.5) node [text=black,above] {};
\end{tikzpicture}
这是上述代码的输出 - 不是我想要的。如果你理解我的问题中的集合符号,你就会明白我希望 C 被填充,除了图表中间 A、B 和 C 都相交的小部分(即,我不想在与 A、B 和 C 共有成员的集合相对应的区域中涂阴影)。
我不够聪明,不知道如何使用剪辑来实现这一点。请帮帮我!
答案1
答案2
下面的代码应该可以做你想做的事情(基于http://www.texample.net/tikz/examples/venn-diagram/):
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[gray] (0.6,-1.04) circle (1);
\begin{scope}
\clip (0.6,-1.04) circle (1);
\clip (1.2,0) circle (1);
\fill[white] (0,0) circle (1);
\end{scope}
\draw (0,0) circle (1) (0,1) node [text=black,above] {$A$};
\draw (1.2,0) circle (1) (1,1.01) node [text=black,above right] {$B$};
\draw (0.6,-1.04) circle (1) (1.7,-1.7) node [text=black] {$C$};
\draw (2.7,-2.54) rectangle (-1.5,1.5);
\end{tikzpicture}
\end{document}
答案3
C \setminus 的要求答案(A \cap B \cap C)
\begin{tikzpicture}
% frame
\draw (2.7,-2.54) rectangle (-1.5,1.5);
% area
\fill[gray] (0.6,-1.04) circle (1);
\begin{scope}
\clip (0.6,-1.04) circle (1) (1.1,-0.6);
\begin{scope}
\clip (0,0) circle (1);
\fill[white] (1.2,0) circle (1) (0,1);
\end{scope}
\end{scope}
% outline
\draw (0,0) circle (1) (0,1) node [text=black,above] {$A$};
\draw (1.2,0) circle (1) (0,1) node [text=black,above right,shift={(1,0.01)}] {$B$};
\draw (0.6,-1.04) circle (1) (1.1,-0.6) node [text=black, shift={(0.6,-1.1)}] {$C$};
\end{tikzpicture}
未要求回答 C \setminus (A \cap B)
绘制您不需要剪切,也不需要“奇偶规则”,只需按照正确的顺序绘制圆圈。
\begin{tikzpicture}
% frame
\draw (2.7,-2.54) rectangle (-1.5,1.5);
% area
\fill[gray] (0.6,-1.04) circle (1);
\fill[white] (0,0) circle (1) (0,1);
\fill[white] (1.2,0) circle (1);
% outline
\draw (0,0) circle (1) (0,1) node [text=black,above] {$A$};
\draw (1.2,0) circle (1) (0,1) node [text=black,above right,shift={(1,0.01)}] {$B$};
\draw (0.6,-1.04) circle (1) (1.1,-0.6) node [text=black, shift={(0.6,-1.1)}] {$C$};
\end{tikzpicture}
这给出了结果。