答案1
看看这个快速代码是否接近你想要的
\documentclass[tikz,margin=1]{standalone}
\usepackage{amsmath}
\DeclareMathOperator{\inw}{inw}
\begin{document}
\begin{tikzpicture}[scale=0.7]
\begin{scope}
\clip (0,0) circle (2);
\fill[gray!30] (3,0) circle (2);
\end{scope}
\draw[very thick] (0,0) node {$A$} circle (2) (3,0) node {$B$} circle (2);
\draw (1.5,0) -- (1.5,-2) node[below] {$A\cap B$};
\draw (-3,-3) rectangle (6,3);
\path (5.5,2.5) node[below left] {$V$};
\draw (0,2) -- ++ (0,1.5) node[above] {$\overline{A}$};
\draw (-1,.5) -- ++ (-2.5,0) node[left] {$\inw(A)$};
\end{tikzpicture}
\end{document}
仅使用\clip
,就可以节省大量时间(我相信单击鼠标确实很耗时)。
答案2
与 JouleV 的答案非常相似,但绘制圆圈(这里它们是节点)和阴影交叉点的方法不同。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{amsmath}
\DeclareMathOperator{\inw}{inw}
\usetikzlibrary{backgrounds}
\tikzset{use path/.code=\pgfsetpath#1} % learned from Kpym
\begin{document}
\begin{tikzpicture}
\node[thick,circle,draw,inner sep=1em,save path=\pathA] (A) at (-0.5,0) {$A$};
\node[thick,circle,draw,inner sep=1em,save path=\pathB] (B) at (0.5,0) {$B$};
\begin{scope}[on background layer]
\clip[use path=\pathA];
\fill[gray!30,use path=\pathB];
\end{scope}
\draw ([xshift=-2em,yshift=-1.5em]current bounding box.south west)
rectangle ([xshift=2em,yshift=1.5em]current bounding box.north east);
\draw (0,0) -- (0,-2em) node[below] {$A \cap B$};
\draw ([xshift=-1ex,yshift=1ex]A.center) -- ++ (-1.5,0) node[left]{$\inw(A)$};
\draw (A.north) -- ++ (0,2em) node[above]{$\overline{A}$};
\end{tikzpicture}
\end{document}