# Tag Info

41

No clipping or even-odd-rule required: \documentclass[tikz,border=5]{standalone} \tikzset{% v 0/.style={fill=white}, v 1/.style={fill=blue!30}, pics/venn/.style args={#1#2#3#4}{code={% \fill [v #1/.try] (-2,-1.5) rectangle (2,1.5); \fill [v #2/.try] (90:sin 60) arc (120:-120:1) arc (-60:60:1); \fill [v #3/.try] (90:sin 60) arc (60:300:1) ...

17

Well you can just remove the (C) and you are done \documentclass{article} \usepackage{tikz} \makeatletter \def\venn@strip#1#2\venn@STOP{\def\venn@next{#1}\gdef\venn@rest{#2}} \newcommand{\venn}[1]{% \begin{tikzpicture}[scale=0.2] \coordinate (A) at (0,0); \coordinate (B) at (2,0); \coordinate (S-SE) at (5,-3); \coordinate (S-NW) at (-3,{sqrt(3)+3}); \...

16

One possibility using TikZ for the first row and pgfplots together with its fillbetween library (requires an updated version of the package) for the second row. The third column is left as an exercise: \documentclass{article} \usepackage{pgfplots} \usepackage{subcaption} \pgfplotsset{compat=1.10} \usepgfplotslibrary{fillbetween} \pgfmathdeclarefunction{...

14

The areas in the diagrams are drawn with a combination of clip and fill commands. Each bit position encodes one of the four intersection free areas of the diagram. These areas are drawn independently. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \def\w{1.35} \def\h{1} \pgfmathsetmacro\rad{\h*.35} \def\sep{.2} \...

13

And here's a version in Metapost for comparison. This exploits a feature of buildcycle with two circular paths that was discussed in my answer to this quesion. prologues := 3; outputtemplate := "%j%c.eps"; color venn_color; venn_color = 0.8[blue,white]; vardef venn(expr p, q, r, s) = save a, b, c, d, f, u; path a,b,c,d, f[]; u = 1cm; f1 = fullcircle ...

12

A possible implementation with the new Blend Modes feature from TikZ v. 3.0.0 (see What are the new features in TikZ/pgf 3.0?). This allows to avoid using some clip operation: \documentclass[tikz,border=10pt]{standalone} \begin{document} \def\firstcircle{(0,0) circle (3.0cm)} \def\secondcircle{(360:3.5cm) circle (3.0cm)} \begin{tikzpicture}[blend group=...

11

My audacious mathematical theory about Euler diagrams seem to have failed to convince in the comments, so I revert back. (and my code did not compile due to a linebreak) Anyway, I borrow some of the techniques demo'd by @CarLaTeX here. Props to her ! Edits Fixed colors and fonts Added CSS-like padding syntax No more rules, added node for title ...

10

with symmetry in circle placing the drawing of all elements is simpler: \documentclass{article} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture} \fill[gray!50] (-0.75,0) circle (1cm); \fill[gray!50] ( 0.75,0) circle (1cm); \draw (-0.75,0) circle (1cm) node {$A$}; \draw ( 0.75,0) circle (1cm) node {$B$}; \draw (-...

10

A code with the dedicated package: \documentclass[svgnames]{article} \usepackage{venndiagram} \begin{document} \begin{venndiagram3sets}[labelA= ,labelB= , labelC= ,radius=2cm, overlap=2cm]% \setkeys{venn}{shade=OliveDrab!40} \fillACapBCapC \setpostvennhook {% \draw (labelA) ++(-120:1.8cm) node{$A$}; \draw (labelB) ...

10

You can use the vendiagram package. Its very easy to use. Do you mean something like this? \documentclass[]{article} \usepackage{tikz,venndiagram} \begin{document} \begin{venndiagram3sets} \fillOnlyC \fillBCapCNotA \fillACapCNotB \end{venndiagram3sets} $C\setminus (A \cap B \cap C)$ \end{document}

8

In venndiagram.sty on lines 138, 140, 147, 159, 151, 153, the arguments of atan2 are in the wrong order. When I reverse them, one gets the desired results. What I mean is that the original arguments to atan2 were entered as (dx,dy), but they should be entered as (dy,dx). Corrected passage: (lines 128-164) \def\fillOnlyA{% \begin{scope} \path[...

8

I don't know what it should look like (I'm colorblind so everything looks OK to me) but here is the second one. Ifyour viewer can handle it play with the blend mode parameter for different effects. \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[mys/.style={pink!80,fill opacity=0.5,draw=black }] \begin{scope}[transparency group] \...

8

If I may, given Gonzalo Medina's solution, this proposal provides a complement solution where clip technique within scope environment is used. Note: For those without updated version of the pgfplots package. Code \documentclass[border=10pt]{standalone}%{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \pgfmathdeclarefunction{gauss}{2}{% \...

8

Here is a nice introduction I found to drawing Venn diagrams: http://users.ju.edu/hduong/math220/venn_diagrams.pdf I put it here, since this question is one of the first results google gives when looking for "how to draw Venn diagrams" (naturally), and also other places refer here, but I feel none of the answers give an introduction to drawing Venn ...

8

Another solution with nodes placed on a matrix (you could also use positioning library) and color boxes drawn as fit nodes on a background layer. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{matrix, backgrounds, fit} \usepackage{lmodern} \begin{document} \begin{tikzpicture}[mytext/.style={text=white, font=\sffamily\large}] \matrix (N) [ ...

8

A solution with "plain tikz": \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds,positioning} \usepackage{float} \usepackage{showframe} \begin{document} \begin{figure}[H] \centering \begin{minipage}[t]{0.45\textwidth} \begin{tikzpicture}[scale=0.6] \draw (-4,-3)rectangle (6,3); \fill[gray,...

7

You tagged tikz-pgf, so here goes. The shadings library is used to shade the ring similar to your image. The even odd rule makes it possible to use another circle to not-fill the inner part. As both circular paths use different line option (one is blue-ish, the other is one black) we cannot use the same \path (implicitly called by \shade) but use two ...

7

Another option could be to use xpatch to patch those two environments, either removing the line altogether, or adding a style to the path, like this: \documentclass[border=5mm]{standalone} \usepackage{venndiagram} \usepackage{xpatch} \tikzset{ vennframe/.style={draw=none} % define a new style for the frames } \makeatletter \xpatchcmd{\endvenndiagram3sets} ...

7

Welcome to TeX.SE! It is good that you included your code. In terms of drawing a rectangle around the venn diagram, you could import the fit library from Tikz using \usetikzlibrary{fit}. I have completed an example to illustrate. Also, I have changed the code a little bit. You now have one tikzpicture (with no minipage). The first venn diagram has its own ...

7

Here is a different approach. We fill the second and third circles with white, then fill the first circle with yellow. Finally, we color the intersection of the three circles white. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,backgrounds} \begin{document} \def\firstcircle{(0,0) circle (1.5 cm)} \def\secondcircle{(0: 2 cm) circle (1....

7

From your code with minor changes: using \draw[fill=orange!60] (0.9,1.5) circle(1.5); and removing \clip (0.9,1.5) circle(1.5cm); \documentclass[tikz,border=0.2cm]{standalone} \begin{document} \begin{tikzpicture}[thick] \draw[fill=black!30] (0,0) circle(1.5) +(135:1.8) node{$A$} (1.8,0) circle(1.5) +(45:1.8) node{$B$}; % Intersection \begin{scope} ...

6

This is now fixed in venndiagram v1.1 which checks \pgfversion to determine what syntax to use for atan2, so venndiagram should now work with both pgf v2.0 and pgf v3.0.

6

There is a simple package to Venn diagrams, maybe somebody likes this: package venndiagram. I'm using it, it's enough for me.

6

The following code should do what you want (based on http://www.texample.net/tikz/examples/venn-diagram/): \documentclass[border=2mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \fill[gray] (0.6,-1.04) circle (1); \begin{scope} \clip (0.6,-1.04) circle (1); \clip (1.2,0) circle (1); \fill[white] (0,0) circle (1); \end{scope} \...

6

With path picture you can fill a path with whatever you want and keep it clipped to the original path. Does it help? \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning, shapes.geometric} \begin{document} \begin{tikzpicture} \draw[blue] (0,0) ellipse(2cm and 3cm) [path picture={ \node[draw=blue, minimum width=4cm, minimum ...

6

Something like this (it's just a rough proposition): \documentclass[border=5pt,tikz]{standalone} \usetikzlibrary{patterns} %\usepackage{venndiagram} % \begin{document} %\begin{venndiagram2sets}[shade=orange,tikzoptions={red}] % \fillA %\end{venndiagram2sets} \begin{tikzpicture}[red,every node/.style={font=\Large}] \draw[pattern=north west lines] (0,...

Only top voted, non community-wiki answers of a minimum length are eligible