编辑::我看到了这里版主认为我的是重复的。但是,我看不出我的是重复的。我的主要问题是在 CAT B 和 CAT C 的交叉点上写文字。
以下是我的代码和输出:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}[blend group = soft light]
\fill[red!30!white] ( 90:1.2) circle (2);
\fill[green!30!white] (210:1.2) circle (2);
\fill[blue!30!white] (330:1.2) circle (2);
\end{scope}
\node at ( 90:2) {CAT A};
\node at ( 210:2) {CAT B};
\node at ( 330:2) {CAT C};
\node [font=\small] {text1, text2, text3, text4};
\end{tikzpicture}
\end{document}
答案1
我提供了两个示例。第一个示例的布局与您发布的内容不同,因为我重新使用了之前做过的一些内容。第二个示例使用了包venndiagram
。
这是代码:
\documentclass[tikz,border=2pt,multi]{standalone}
\usepackage{venndiagram}
\tikzset{venn circle/.style={draw=gray,text opacity=1,fill opacity=0.25,circle,minimum width=10cm,fill=#1,line width=2pt}}
\tikzset{label/.style={text width=1.5cm,font=\large\sffamily}}
\begin{document}
\begin{tikzpicture}
\begin{scope}[blend mode=screen]
\node [venn circle = yellow] (A) at (0,0) {};
\node [label] (A1) at (-2.5,0) {Cat A};
%
\node [venn circle = green] (B) at (5,0) {};
\node [label] (B1) at (7.5,0) {Cat B};
%
\node [venn circle = orange] (C) at (2.5,5) {};
\node [label] (C1) at (2.5,6.25) {Cat C};
% Use a tabular to stack the text
\node [label] (D) at (5,3.75){\begin{tabular}{l} text1,\\text2,\\text3,\\text4 \end{tabular}};
\end{scope}
\end{tikzpicture}
\begin{venndiagram3sets}[radius=5cm,overlap=3cm,
tikzoptions={text opacity=1,fill opacity=0.25},
labelOnlyBC={\begin{tabular}{l} text1,\\text2,\\text3,\\text4 \end{tabular}}]
\fillBCapCNotA
\end{venndiagram3sets}
\end{document}
答案2
答案3
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}
\begin{document}
\begin{tikzpicture}
\begin{scope}[blend group = soft light]
\fill[green!30!white] ( 90:1.2) circle (2);
\fill[blue!30!white] (210:1.2) circle (2);
\end{scope}
\node at ( 90:2) {A};
\node at ( 210:2) {B};
\node [font=\Large] {AUB};
\draw (0,0) rectangle (4,4) node [text=black,above] {U};
\end{tikzpicture}
\end{document}