标记 3 个集合的交集

标记 3 个集合的交集

我想使用乳胶制作维恩图,这里我已经制作好了:

\documentclass[tikz,border=10pt]{standalone} 
\usetikzlibrary{positioning,backgrounds}

\begin{document}

\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(60:2.1cm) circle (1.5cm)}
\def\thirdcircle{(0:2.1cm) circle (1.5cm)}

\begin{tikzpicture}

\draw \firstcircle node[below] {$1$};
\draw \secondcircle node [above] {$2$};
\draw \thirdcircle node [below] {$3$};

\node [text=black] at (30:20mm) {2};
\node [text=black, anchor=west, xshift=-2mm] at (90:10mm) {1};
\node (m) [text=black, below] at (0:10.5mm) {3};

\end{tikzpicture}
\end{document}

在此处输入图片描述

我的问题:如何在第一、第二和第三个圆的交叉点进行标记(或者按照您的判断)?

答案1

选择你的风格。

在此处输入图片描述 在此处输入图片描述

\documentclass[12pt,tikz]{standalone}
\begin{document}
  \def\r{1}
  \def\R{1.3}
\begin{tikzpicture}[scale=1.5]
  \foreach\ang/\name in {-150/a,-30/b,90/c} \draw (\ang:\r) circle (\R) coordinate (\name) node {\name};
  \path (a) -- (b) node [midway] (ab) {ab} ;
  \path (b) -- (c) node [midway] (bc) {bc} ;
  \path (c) -- (a) node [midway] (ca) {ca} ;
  \path (c) -- (ab) node [pos=.667] (abc) {abc}; % actually (abc) is at (0,0) in this config !
\end{tikzpicture}
\begin{tikzpicture}[scale=1.5]
  \foreach\ang/\name in {-150/a,-30/b,90/c} \draw (\ang:\r) circle (\R) coordinate (\name) node {\name};
  \path (a) -- (b) coordinate [midway] (ab) ;
  \path (b) -- (c) coordinate [midway] (bc) ;
  \path (c) -- (a) coordinate [midway] (ca) ;
  \path (c) -- (ab) coordinate [pos=.667] (abc) node [pos=.667] {abc};
  \path (abc) -- (a) node [pos=-.75] {ab} ;
  \path (abc) -- (b) node [pos=-.75] {bc} ;
  \path (abc) -- (c) node [pos=-.75] {ca} ;
\end{tikzpicture}
\end{document}

答案2

带有专用包的代码:

    \documentclass[svgnames]{article}
    \usepackage{venndiagram}

    \begin{document}

    \begin{venndiagram3sets}[labelA= ,labelB= , labelC= ,radius=2cm, overlap=2cm]%
    \setkeys{venn}{shade=OliveDrab!40}
    \fillACapBCapC
    \setpostvennhook
    {%
    \draw (labelA) ++(-120:1.8cm) node{$ A$};
     \draw (labelB) ++(-60:1.8cm) node{$B$};
     \draw (labelC) ++(90:1.2cm) node{$C$};
    \draw (labelABC) ++(90:0.2cm) node{$A\cap B\cap C$}; 
    }%

    \end{venndiagram3sets}

    \end{document}

在此处输入图片描述

答案3

很久以前,当我阅读有关概率的文章时,我写下了这些笔记,作为一种工具,通过可视化来简化多事件交互。希望你觉得它们有用。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usepackage{geometry}
\geometry{ a4paper,total={170mm,257mm},left=20mm,top=20mm}


\begin{document}
% Definition of circles
\def\firstcircle{ (0.0, 0.0) circle (1.5)}
\def\secondcircle{(2.0, 0.0) circle (1.5)}
\def\thirdcircle{ (1.0,-1.5) circle (1.5)}
\def\rectangle{ (-1.5,-3.0) rectangle (3.5,1.0) }
\colorlet{circle edge}{black}
\colorlet{circle area}{blue!30}

\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
    outline/.style={draw=circle edge, thick}}

\setlength{\parskip}{5mm}
%############################################################################
%############################################################################
%############################################################################
\noindent
\begin{tikzpicture}
    \begin{scope}
        \clip  \firstcircle;
        \clip  \secondcircle;
        \fill[filled]   \thirdcircle ;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) {$A \cap B \cap C$};
\end{tikzpicture} \qquad
%############################################################################
%############################################################################
%############################################################################
\begin{tikzpicture}
    \begin{scope}
        \clip \firstcircle \secondcircle \thirdcircle;
        \fill[filled]  \firstcircle \secondcircle \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) {$A \cup B \cup C$};
\end{tikzpicture} \qquad
%############################################################################
%############################################################################
%############################################################################
\begin{tikzpicture}
    \begin{scope}
        \clip \firstcircle;
        \fill[filled] \secondcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south,align=center] at (current bounding box.north) 
      {$(A\cap B)=$\\$(A \cap B \cap C) + (A \cap B \cap C')$};
\end{tikzpicture} \\[1.5cm]
%############################################################################
%############################################################################
%############################################################################
\begin{tikzpicture}
    \begin{scope}
        \clip \firstcircle;
        \fill[filled] \thirdcircle;
    \end{scope}
    \begin{scope}
        \clip \firstcircle;
        \clip \secondcircle;
        \fill[white] \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$(A\cap B' \cap C)$};
\end{tikzpicture} \qquad
%############################################################################
%############################################################################
%############################################################################
\begin{tikzpicture}
    \begin{scope}
        \fill[filled] \thirdcircle;
        \fill[white]  \firstcircle;
        \fill[white]  \secondcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$(A' \cap B' \cap C)$};
\end{tikzpicture} \qquad
%############################################################################
%############################################################################
%############################################################################
\begin{tikzpicture}
     \begin{scope}
        \clip \secondcircle;
        \fill[filled] \thirdcircle;
    \end{scope}
    \fill[filled]  \firstcircle;
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$A \cup (B \cap C)$};
\end{tikzpicture} \\[1.5cm]
%############################################################################
%############################################################################
%############################################################################
\begin{tikzpicture}
     \begin{scope}
        \clip \firstcircle \secondcircle;
        \fill[filled] \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$(A \cup B) \cap C$};
\end{tikzpicture} \qquad

\end{document}

答案4

有一个包用于此!

在此处输入图片描述

\documentclass{article}
\usepackage{venndiagram}
\usepackage[margin=1in]{geometry}
\begin{document}
\begin{venndiagram3sets}[labelABC={\raisebox{10ex}{$A\cap B \cap C$}},tikzoptions={scale=3,thick}]
\end{venndiagram3sets}
\end{document}

相关内容