在 LaTeX 中编辑维恩图

在 LaTeX 中编辑维恩图

我使用以下代码制作了维恩图。

\begin{tikzpicture}     

        \def\firstcircle{(90:1.75cm) circle (2.5cm)} \def\secondcircle{(210:1.75cm) circle (2.5cm)} \def\thirdcircle{(330:1.75cm) circle (2.5cm)}
        \draw \firstcircle 
        node[below] {$instinct$};
        \draw \secondcircle
        node [above] {$valar$}; 
        \draw \thirdcircle 
        node [below] {$Mystic$};
     node[center] {} 
        \begin{scope}
        \clip \firstcircle;
        \fill[yellow]
        \secondcircle; 
        \end{scope} 
        \begin{scope}
        \clip \firstcircle;
        \fill[purple] \thirdcircle; 
        \end{scope}
        \begin{scope} 
        \clip \secondcircle;
        \fill[blue] \thirdcircle; 
        \end{scope}

\end{tikzpicture}

并得到这样的结果

在此处输入图片描述

我希望中心像这样是白色,我该怎么做

在此处输入图片描述

答案1

这是一个解决方案,scope为三个圆的交点添加一个环境。

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}     
        \def\firstcircle{(90:1.75cm) circle (2.5cm)} \def\secondcircle{(210:1.75cm) circle (2.5cm)} \def\thirdcircle{(330:1.75cm) circle (2.5cm)}
        \begin{scope}
        \clip \firstcircle;
        \fill[yellow]
        \secondcircle; 
        \end{scope} 
        \begin{scope}
        \clip \firstcircle;
        \fill[purple] \thirdcircle; 
        \end{scope}
        \begin{scope} 
        \clip \secondcircle;
        \fill[blue] \thirdcircle; 
        \end{scope}
        \begin{scope} 
        \clip \secondcircle;
        \clip \firstcircle;
        \fill[white] \thirdcircle; 
        \end{scope}
        \draw \firstcircle 
        node[above] {$Instinct$};
        \draw \secondcircle
        node [above left] {$Valar$}; 
        \draw \thirdcircle 
        node [below right] {$Mystic$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容