1

This question is related by two questions:

Venndiagram with 4-sets: how to change the .sty file with modifications

Two-set and three-set diagrams: venndiagram package

Now I have this code with 3 sets:

\documentclass[a4paper,12pt]{article}
\usepackage{venndiagram}
\begin{document}
\begin{venndiagram3sets}[labelOnlyA={5},labelOnlyB={4},labelOnlyC={2},
labelOnlyAB={1},labelOnlyAC={3},labelOnlyBC={4},labelABC={5},
labelNotABC={8}]
\setpostvennhook{\node[above right] at (venn top right){$|U|=30$};}
\end{venndiagram3sets}
\end{document}

enter image description here

and another with 2 sets:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb,venndiagram}
\begin{document}
\begin{venndiagram2sets}[labelOnlyA={5},labelOnlyB={7}, labelAB={4},labelNotAB={15}]
\setpostvennhook{\node[above right] at (venn top right){$|U|=30$};}
\end{venndiagram2sets}
\end{document}

enter image description here

My requests are:

  1. Is it possible to change the label of A, B or C with other letters (for example M, F, O, etc.) using venndiagram package for two or three sets of the drawing?
  2. Is it possible to coloured only the circle of the sets using venndiagram package for two or three sets of the drawing?
Sebastiano
  • 54,118
  • 1
    For what strange reason is there a request for closure to my question? – Sebastiano Oct 28 '23 at 12:16
  • 2
    The manual describes various \fill… macros. It also has the shade key. – Qrrbrbirlbel Oct 28 '23 at 22:56
  • @Qrrbrbirlbel Yes I have seen. I think that the color is only lightgray. – Sebastiano Oct 29 '23 at 19:42
  • Yeah, as I said before, the package isn't very versatile. You will either need to overwrite the color lightgray locally or some other way to set \@venn@shade (or use the shade key outside of the optional argument of the environments). We can of course define a bunch of commands that so this for you or patch all the \fill… macros (but most of them are being defined right there in the \begin{venndiagramXsets}). It's either manual, half-automatic with another set of macros or reimplementation. – Qrrbrbirlbel Oct 29 '23 at 20:01
  • @Qrrbrbirlbel You are free to do with venndiagram whatever you like. – Sebastiano Oct 29 '23 at 22:18

2 Answers2

2

From the documentation I can see that your first request is easy, but your second is a bit harder.

enter image description here

I produced the picture above using this version of your 3-circle diagram:

\documentclass[border=5mm]{standalone}
\usepackage{venndiagram}
\begin{document}
\begin{venndiagram3sets}[
    labelA=$M$, labelB=$N$, labelC=$O$,  % <-- change circle labels
    tikzoptions={draw=red},              % <-- draw all lines in red
    labelOnlyA={5},labelOnlyB={4},labelOnlyC={2},
    labelOnlyAB={1},labelOnlyAC={3},labelOnlyBC={4},labelABC={5},
    labelNotABC={8}]
\setpostvennhook{\node[above right] at (venn top right){$|U|=30$};}
\end{venndiagram3sets}
\end{document}

I cannot see a way of getting it to draw the frame in a different colour from the circles.

Thruston
  • 42,268
2

Expanding on Thruston's answer:

You can disable drawing the frame first and than manually draw it using \draw[black] (venn top right) rectangle (venn bottom left);.

\documentclass[border=5mm]{standalone}
\usepackage{venndiagram}
\begin{document}
\begin{venndiagram3sets}[
    labelA=$M$, labelB=$N$, labelC=$O$,  % <-- change circle labels
    tikzoptions={draw=red},              % <-- draw all lines in red
    labelOnlyA={5},labelOnlyB={4},labelOnlyC={2},
    labelOnlyAB={1},labelOnlyAC={3},labelOnlyBC={4},labelABC={5},
    labelNotABC={8},
    showframe=false                      % <-- disable frame
]
\setpostvennhook{\node[above right] at (venn top right){$|U|=30$};}
% draw frame in black
\draw[black] (venn top right) rectangle (venn bottom left);
\end{venndiagram3sets}
\end{document}

enter image description here

  • I thank you further for the implementation of Thruston's response. I do not understand why an attempt is being made to close my question. +1. – Sebastiano Oct 28 '23 at 19:31
  • 2
    @Sebastiano I don’t know either. Maybe because it contains two questions instead of just one. I voted for “keep open”. – Jasper Habicht Oct 28 '23 at 19:32
  • Thank you very very much. But I have seen that the closure is Needs more focus This question currently includes multiple questions in one. It should focus on one problem only.. For me it is not true. – Sebastiano Oct 28 '23 at 19:34
  • 1
    @Sebastiano I'm no close voter, but your post obviously contains multiple questions, and not just a single question, that is a fact and has nothing to do with subjective interpretation, and it's not like you could say one of the questions is just a boundary condition to the other, they are two completely independent questions, which just happen to be about the same package. – Skillmon Oct 28 '23 at 21:46
  • @Skillmon Hi. I find it all so so strange. I found it unnecessary to break my request into two separate questions. What is the point? I'm sorry but I don't interact with any user in this way. – Sebastiano Oct 28 '23 at 21:49