How can I draw a rectangle around a Venn Diagram: A \cap B, A \cup B, etc? Thanks
Graphics, Figures & Tables ⇒ Venn Diagram help
- Stefan Kottwitz
- Site Admin
- Posts: 10314
- Joined: Mon Mar 10, 2008 9:44 pm
Venn Diagram help
Hi,
perhaps show the code that you are using, and some of us could add the rectangle. For now, nobody knows how the diagram is actually made. I just assume it's done in TikZ. So one could use the
Stefan
perhaps show the code that you are using, and some of us could add the rectangle. For now, nobody knows how the diagram is actually made. I just assume it's done in TikZ. So one could use the
fit
library, or ad it manually.Stefan
LaTeX.org admin
-
- Posts: 3
- Joined: Mon May 15, 2017 5:25 pm
Venn Diagram help
The code...
Code: Select all
\begin{figure}[h]
% Definition of circles
\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(0:2cm) circle (1.5cm)}
\colorlet{circle edge}{blue!50}
\colorlet{circle area}{blue!20}
\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
outline/.style={draw=circle edge, thick}}
\setlength{\parskip}{5mm}
% Set A or B
\begin{tikzpicture}
\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$A \cup B$};
\end{tikzpicture}
\caption{Representação gráfica de operações com conjuntos}
\label{fig1}
\end{figure}
Last edited by Stefan Kottwitz on Tue May 16, 2017 12:32 am, edited 1 time in total.
- Stefan Kottwitz
- Site Admin
- Posts: 10314
- Joined: Mon Mar 10, 2008 9:44 pm
Venn Diagram help
The easiest way is
Stefan
\fbox
:Code: Select all
\fbox{\begin{tikzpicture}
\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$A \cup B$};
\end{tikzpicture}}
LaTeX.org admin