我想在 LaTeX 中创建这个维恩图(可能使用 TikZ):
您能给我指明正确的方向吗?我见过很多使用 TikZ 的维恩图示例,但没有一个带有同心圆的。
答案1
\documentclass[tikz,border=12pt]{standalone}
\begin{document}
\begin{tikzpicture}
\path
(0,0) rectangle (8,6) [draw]
(0.5,5.5) node {$\emptyset$}
(2.5,2) coordinate (A) node[below] {3.4} ellipse (2 and 1.5) [draw]
coordinate (temp) at (2.5,2) ellipse (0.6 and 0.6) [draw]
(temp) +(0.5,-0.75) coordinate (B) node[below left] {5.1} -- (5,3.5) -- (5.5,3.5) node[right,text width=1.5]{Environment\\contact}
(A) -- (4.5,4.5) -- (5,4.5) node[right]{Patient contact} ;
\end{tikzpicture}
\end{document}
答案2
像这样吗?
\documentclass{article}
\usepackage{tikz}
\begin{document}
\def\firstcircle{(0,0) circle (3cm)}
\def\secondcircle{(0,0) circle (1cm)}
\colorlet{circle edge}{black!100}
\colorlet{circle area}{black!0}
\tikzset{filled/.style={fill=circle area, draw=circle edge, thick}, outline/.style={draw=circle edge, thick}}
\setlength{\parskip}{5mm}
\begin{tikzpicture}
\draw[outline] \firstcircle node {3.4};
\draw (0,0.25) -- ++(5,2.5) node [fill=white] {Patient Contact};
\draw[outline] \secondcircle node {};
\draw (0,-1.75) -- ++(5,2.5) node [fill=white] {Environment Contact};
\node at (0,-2) (nodeA) {5.1};
\end{tikzpicture}
\end{document}
输出: