所以我想使用 tikz 将以下图表放入我的 LaTeX 文档中。此维恩图显示了 5 组横截面的所有可能组合。我也不想在那里放 ABCDE,而是放文字(不过我想这应该不是问题)。
目前我的代码是:
\begin{tikzpicture}[scale = 1.3,
myellipse/.style={
draw, ellipse,
inner xsep=3.9cm,
inner ysep=2cm}]
\coordinate (C1) at (0,1.15);
\coordinate (C2) at (-0.8,0.5);
\coordinate (C3) at (-0.8,-0.2);
\coordinate (C4) at (0,-0.8);
\coordinate (C5) at (1,0);
\node[myellipse, rotate=-75] at (C1) {};
\node[myellipse, rotate=-10] at (C2) {};
\node[myellipse, rotate=70] at (C3) {};
\node[myellipse, rotate=-40] at (C4) {};
\node[myellipse, rotate=20] at (C5) {};
\end{tikzpicture}
但我就是无法让它看起来正确。参数必须非常精确才能使所有横截面都存在。目前它看起来像这样:
颜色不是必需的。有人能帮我吗?
答案1
实际上,我之所以能相当准确地获得建议的图表,主要是通过反复试验。
我是这样做的:
\usepackage{tikz}
\usetikzlibrary{positioning, fit, shapes.geometric}
...
\begin{tikzpicture}[scale = 1.3,
myellipse/.style={
draw, ellipse,
inner xsep=3.9cm,
inner ysep=2cm}]
\coordinate (R1) at (-5.3,-4.5);
\coordinate (R2) at (5.3,5.5);
\draw (R1) rectangle (R2);
%\draw[step=1, opacity=0.3] (R1) grid (R2);
\coordinate (C1) at (0,1.15);
\coordinate (C2) at (-0.8,0.5);
\coordinate (C3) at (-0.8,-0.2);
\coordinate (C4) at (0,-0.8);
\coordinate (C5) at (1,0);
\node[myellipse, rotate=-75] at (C1) {};
\node[myellipse, rotate=-10] at (C2) {};
\node[myellipse, rotate=70] at (C3) {};
\node[myellipse, rotate=-40] at (C4) {};
\node[myellipse, rotate=20] at (C5) {};
\end{tikzpicture}