0

Here is an example of a venndiagram using the venndiagram package.

\usepackage{venndiagram}
\begin{document}
  \begin{venndiagram2sets}
    \fillANotB  \fillBNotA;
  \end{venndiagram2sets}

The problem is every diagram I make automatically produces joint sets. Is there any way with this package to produce disjoint sets? For example: How do I draw the union of two disjoint sets A and B?

Another related question I have is: Is there a way fill the sets with some other colors than gray under this package?

Thanks

1
  • Please give a minimal working sample which could be compiled.
    – M. Logic
    Apr 26, 2022 at 4:38

1 Answer 1

1

For question 1, use the shade option to set another color, and for question 2, use the overlap to set a negative value. For the color, you'd better use a light one for which you could give an ordinary color with a suitable percent.

\documentclass{article}

\usepackage{venndiagram}

\begin{document}

\begin{venndiagram2sets}[showframe=false,shade=blue!20,overlap=-0.5cm]
\fillA\fillB
\end{venndiagram2sets}

\begin{venndiagram2sets}[shade=blue!20,overlap=-0.5cm]
\fillA\fillB
\end{venndiagram2sets}

\end{document}

enter image description here


If you want to fill the sets with different colors, I advise you to use the tikz package to draw Venn diagrams since it could supply more choices. For example,

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
    \draw[circle, thick,fill=red,fill opacity=0.2] (0,0) circle (1.5cm) node {};
    \node at (0,1) (A) {$A$};
    \draw[circle, thick,fill=blue,fill opacity=0.2] (4,0) circle (1.5cm) node {};
    \node at (4,1) (B) {$B$};
\end{tikzpicture}
\par\vspace{3cm}
\begin{tikzpicture}
    \draw[circle, thick,fill=red,fill opacity=0.2] (0,0) circle (1.5cm) node {};
    \node at (0,1) (A) {$A$};
    \draw[circle, thick,fill=blue,fill opacity=0.2] (2,0) circle (1.5cm) node {};
    \node at (2,1) (B) {$B$};
\end{tikzpicture}

\end{document}

enter image description here


By the way, when to ask a question next time please give a minimal working sample which could be compiled, and then others could answer it more conveniently.

2
  • This worked perfectly. Another question. How do I make both sets have different shade colors?
    – Lex_i
    Apr 26, 2022 at 5:29
  • @Lex_i I update the answer.
    – M. Logic
    Apr 26, 2022 at 8:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .