How to draw a Venn diagram for X - (Y intersect Z)?“Stroke” a predefined pathRemove intersect line for one circle using venndiagram2setsHow is the interior of a path determined when reverse clipping?TikZ: Cropping the Bounding BoxRotate a node but not its content: the case of the ellipse decorationRunning Sample Tikz CodeHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themDraw a rectangle to given Venn DiagramVenn diagram outlines
Why is the car dealer insisting on a loan instead of cash?
How to write characters doing illogical things in a believable way?
If I want an interpretable model, are there methods other than Linear Regression?
Examples of proofs by making reduction to a finite set
Does my opponent need to prove his creature has morph?
Difference between system uptime and last boot time in windows
Is it possible to format a USB from a live USB?
'Overwrote' files, space still occupied, are they lost?
Why does the speed of sound decrease at high altitudes although the air density decreases?
International Orange?
Planar regular languages
Shouldn't countries like Russia and Canada support global warming?
What are the advantages and disadvantages of tail wheels that cause modern airplanes to not use them?
Output a Super Mario Image
Can I travel to European countries with the Irish passport and without destination Visa?
What would happen if Protagoras v Euathlus were heard in court today?
Is there a tool to measure the "maturity" of a code in Git?
Is "you will become a subject matter expert" code for "you'll be working on your own 100% of the time"?
What organs or modifications would be needed for a life biological creature not to require sleep?
Wrong Schengen Visa exit stamp on my passport, who can I complain to?
If I'm saying that something is two adjectives and one uses "ser" but the other uses "estar", what should I do?
How to control the output voltage of a solid state relay
How much would a 1 foot tall human weigh?
How would you control supersoldiers in a late iron-age society?
How to draw a Venn diagram for X - (Y intersect Z)?
“Stroke” a predefined pathRemove intersect line for one circle using venndiagram2setsHow is the interior of a path determined when reverse clipping?TikZ: Cropping the Bounding BoxRotate a node but not its content: the case of the ellipse decorationRunning Sample Tikz CodeHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themDraw a rectangle to given Venn DiagramVenn diagram outlines
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to draw a Venn diagram for$ X - (Y cap Z), but I can only figure out how to get $X - (Y cup) Z)? Can anyone help?
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5cm)
defsecondcircle(60:2cm) circle (1.5cm)
defthirdcircle(0:2cm) circle (1.5cm)
begintikzpicture
beginscope[shift=(6cm,0cm)]
beginscope[even odd rule]% first circle without the second
clip thirdcircle (-3, -3) rectangle (3,3);
clip secondcircle (-3, -3) rectangle (3,3);
fill[yellow] firstcircle;
endscope
draw firstcircle node $X$;
draw secondcircle node $Y$;
draw thirdcircle node $Z$;
endscope
endtikzpicture
tikz-pgf venn-diagrams
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
I need to draw a Venn diagram for$ X - (Y cap Z), but I can only figure out how to get $X - (Y cup) Z)? Can anyone help?
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5cm)
defsecondcircle(60:2cm) circle (1.5cm)
defthirdcircle(0:2cm) circle (1.5cm)
begintikzpicture
beginscope[shift=(6cm,0cm)]
beginscope[even odd rule]% first circle without the second
clip thirdcircle (-3, -3) rectangle (3,3);
clip secondcircle (-3, -3) rectangle (3,3);
fill[yellow] firstcircle;
endscope
draw firstcircle node $X$;
draw secondcircle node $Y$;
draw thirdcircle node $Z$;
endscope
endtikzpicture
tikz-pgf venn-diagrams
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
I need to draw a Venn diagram for$ X - (Y cap Z), but I can only figure out how to get $X - (Y cup) Z)? Can anyone help?
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5cm)
defsecondcircle(60:2cm) circle (1.5cm)
defthirdcircle(0:2cm) circle (1.5cm)
begintikzpicture
beginscope[shift=(6cm,0cm)]
beginscope[even odd rule]% first circle without the second
clip thirdcircle (-3, -3) rectangle (3,3);
clip secondcircle (-3, -3) rectangle (3,3);
fill[yellow] firstcircle;
endscope
draw firstcircle node $X$;
draw secondcircle node $Y$;
draw thirdcircle node $Z$;
endscope
endtikzpicture
tikz-pgf venn-diagrams
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I need to draw a Venn diagram for$ X - (Y cap Z), but I can only figure out how to get $X - (Y cup) Z)? Can anyone help?
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5cm)
defsecondcircle(60:2cm) circle (1.5cm)
defthirdcircle(0:2cm) circle (1.5cm)
begintikzpicture
beginscope[shift=(6cm,0cm)]
beginscope[even odd rule]% first circle without the second
clip thirdcircle (-3, -3) rectangle (3,3);
clip secondcircle (-3, -3) rectangle (3,3);
fill[yellow] firstcircle;
endscope
draw firstcircle node $X$;
draw secondcircle node $Y$;
draw thirdcircle node $Z$;
endscope
endtikzpicture
tikz-pgf venn-diagrams
tikz-pgf venn-diagrams
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 8 hours ago
Bernard
191k8 gold badges86 silver badges226 bronze badges
191k8 gold badges86 silver badges226 bronze badges
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
Andrew RubnerAndrew Rubner
261 bronze badge
261 bronze badge
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andrew Rubner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
add a comment
|
5 Answers
5
active
oldest
votes
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.
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5 cm)
defsecondcircle(0: 2 cm) circle (1.5 cm)
defthirdcircle(60:2 cm) circle (1.5 cm)
begintikzpicture
%Define the circles for the Venn diagram for three sets.
draw[fill=white] secondcircle;
draw[fill=white] thirdcircle;
draw[fill=yellow] firstcircle;
% Label the sets.
node[left] at (0, 0) (X);
node[above] at (60: 2 cm) (Y);
node[right] at (0: 2 cm) (Z);
%Color the intersection of all three circles white.
beginscope
clip firstcircle;
clip secondcircle;
draw[fill=white] thirdcircle;
endscope
%Draw the circles.
draw firstcircle;
draw secondcircle;
draw thirdcircle;
endtikzpicture
which produces the diagram

New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
Just for fun!
documentclass[border=10pt,pstricks]standalone
begindocument
beginpspicture(-3,-4)(6,6)
psclip[linestyle=none]%
pscircle[fillstyle=solid,fillcolor=pink](0,0)3
psclip%
pscircle[fillstyle=solid,fillcolor=pink](3;60)3
pscircle[fillstyle=solid,fillcolor=white](3,0)3
endpsclip
endpsclip
pscircle(0,0)3 rput(-1.5,-0.5)$X setminus (Y cap Z)$
pscircle(3,0)3 rput(1.5,3.5)$Y$
pscircle(3;60)3 rput(3.5,-0.5)$Z$
endpspicture
enddocument

Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
add a comment
|
There is a package that specializes on Venn diagrams: venndiagram. One needs to "hack" it a bit since the intersection you are after seems not be in the predefined set, but this is what setpostvennhook is for. This hack defines the interiors and the contours of the circles. They have the names A, B and C, but their labels can be set to X, Y and Z, say.
documentclass[border=10pt]standalone
usepackagevenndiagram
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius]
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
fillA
setpostvennhook
clip[interior=B];
fill[white,interior=C];
draw[contour=A];
endvenndiagram3sets
enddocument

ADDENDUM: Since this is a repeating theme, I am trying to collect some standard tricks here, and also add some stuff to the venndiagram repertoire.
- The
reverse cliptrick allows one to clip on everything outside a given path. - The
even odd cliptrick allows one to apply theeven odd ruleto clips. - I added the styles
interior of, which produce a path that contains the interior of either A, B, or C,contour ofwhich allows one to redraw the contour of either A, B, or C, andcommon of, which allows one to retrieve the intersection of two of the sets. The latter requires thecalclibrary.
Using these tricks, one can avoid overpainting anything in white. We first clip on everything outside the intersection of B and C,
clip[common of=B and C,reverse clip];
and then fill the interior of A,
fill[VennShade,interior of=A];
Complete MWE. (Notice that some care is taken not to add any hard coded distances, the idea being that you produce several diagrams and have common settings.)
documentclass[border=10pt]standalone
usepackagevenndiagram
usetikzlibrarycalc,backgrounds
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
circle[radius=@venn@radius],
midpoint of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
,
common of/.style args=#1 and #2insert path=
let p1=($(csname @venn@#2xendcsname,csname @venn@#2yendcsname)-(csname @venn@#1xendcsname,csname @venn@#1yendcsname)$),
n1=veclen(y1,x1)/2,n2=sqrt(@venn@radius*@venn@radius-n1*n1),
n3=atan2(y1,x1),n4=atan2(n2,n1) in
($(csname @venn@#1xendcsname,csname @venn@#1yendcsname)+(n3+n4:@venn@radius)$)
arc(n3+n4:n3-n4:@venn@radius) arc(n3+180+n4:n3+180-n4:@venn@radius)
-- cycle
%pgfextratypeoutn2,n3,n4,@venn@radius
,
reverse clip/.style=insert path=
(@venn@w,@venn@h) -,
even odd clip/.code=% https://tex.stackexchange.com/a/76216
pgfseteorule
defVennShade@venn@shade
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
setpostvennhook
beginscope[on background layer]
clip[common of=B and C,reverse clip];
fill[VennShade,interior of=A];
endscope
endvenndiagram3sets
enddocument

add a comment
|
Another solution with venndiagram:
documentclass[svgnames, tikz, border=6pt]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagelmodern, amssymb, nccmath
usepackagevenndiagram
begindocument
beginvenndiagram3sets[radius=1.5cm, overlap=1.2cm]%
setkeysvennshade=Lavender, labelA=, labelB=
fillOnlyAfillACapBNotCfillACapCNotB
setkeysvennshade=WhiteSmoke!80!Thistle, labelA=, labelB=
fillBCapC
setpostvennhook
%
draw (labelA) ++(180:1.1cm) node$A$;
draw (labelB) ++(0:1.1cm) node$B$;
draw (labelABC) ++(-20:0.6cm) node[text=MediumVioletRed]$medmath B ∩ C$;
draw (labelA) ++(-100:1.2cm) node[text=NavyBlue]$medmathAsmallsetminus(Bcap C)$;
%
endvenndiagram3sets
enddocument

All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax fornode$colorMediumVioletRedmedmath B ∩ C$isnode[text=MediumVioletRed]$medmath B ∩ C$.
– Schrödinger's cat
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
add a comment
|
This is usual clip of TikZ as Taussig did above. Maybe I am a bit difficult when considering plainess and flexibility of the TikZ code.

documentclass[tikz,border=5mm]standalone
begindocument
begintikzpicture
defr1.5 defd1
deffirstC(90:d) circle(r)
defsecondC(-30:d) circle(r)
defthirdC(210:d) circle(r)
fill[magenta!30] firstC;
beginscope
clip firstC;
clip secondC;
fill[white] thirdC;
endscope
draw firstC secondC thirdC;
path
(90:1.2*d) node[magenta,scale=.6]$Asetminus (Bcap C)$
(90:2*d) node$A$
(210:2*d) node$B$
(-30:2*d) node$C$;
endtikzpicture
enddocument
Here are translation to Asymptote code (exactly the same picture).
unitsize(1cm);
real r=1.5,d=1;
pair A=d*dir(90),B=d*dir(210),C=d*dir(-30);
path firstC=circle(A,r);
path secondC=circle(B,r);
path thirdC=circle(C,r);
fill(firstC,.3magenta+.7white);
picture BcapC;
fill(BcapC,thirdC,white);
clip(BcapC,firstC);
clip(BcapC,secondC);
add(BcapC);
draw(firstC^^secondC^^thirdC);
label("$A$",2A);
label("$B$",2B);
label("$C$",2C);
label((scale(.6))*"$Asetminus (Bcap C)$",1.2A,magenta);
add(bbox(5mm),Fill(white));
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Andrew Rubner is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f508277%2fhow-to-draw-a-venn-diagram-for-x-y-intersect-z%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5 cm)
defsecondcircle(0: 2 cm) circle (1.5 cm)
defthirdcircle(60:2 cm) circle (1.5 cm)
begintikzpicture
%Define the circles for the Venn diagram for three sets.
draw[fill=white] secondcircle;
draw[fill=white] thirdcircle;
draw[fill=yellow] firstcircle;
% Label the sets.
node[left] at (0, 0) (X);
node[above] at (60: 2 cm) (Y);
node[right] at (0: 2 cm) (Z);
%Color the intersection of all three circles white.
beginscope
clip firstcircle;
clip secondcircle;
draw[fill=white] thirdcircle;
endscope
%Draw the circles.
draw firstcircle;
draw secondcircle;
draw thirdcircle;
endtikzpicture
which produces the diagram

New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
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.
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5 cm)
defsecondcircle(0: 2 cm) circle (1.5 cm)
defthirdcircle(60:2 cm) circle (1.5 cm)
begintikzpicture
%Define the circles for the Venn diagram for three sets.
draw[fill=white] secondcircle;
draw[fill=white] thirdcircle;
draw[fill=yellow] firstcircle;
% Label the sets.
node[left] at (0, 0) (X);
node[above] at (60: 2 cm) (Y);
node[right] at (0: 2 cm) (Z);
%Color the intersection of all three circles white.
beginscope
clip firstcircle;
clip secondcircle;
draw[fill=white] thirdcircle;
endscope
%Draw the circles.
draw firstcircle;
draw secondcircle;
draw thirdcircle;
endtikzpicture
which produces the diagram

New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
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.
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5 cm)
defsecondcircle(0: 2 cm) circle (1.5 cm)
defthirdcircle(60:2 cm) circle (1.5 cm)
begintikzpicture
%Define the circles for the Venn diagram for three sets.
draw[fill=white] secondcircle;
draw[fill=white] thirdcircle;
draw[fill=yellow] firstcircle;
% Label the sets.
node[left] at (0, 0) (X);
node[above] at (60: 2 cm) (Y);
node[right] at (0: 2 cm) (Z);
%Color the intersection of all three circles white.
beginscope
clip firstcircle;
clip secondcircle;
draw[fill=white] thirdcircle;
endscope
%Draw the circles.
draw firstcircle;
draw secondcircle;
draw thirdcircle;
endtikzpicture
which produces the diagram

New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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.
documentclassarticle
usepackagetikz
usetikzlibraryshapes,backgrounds
begindocument
deffirstcircle(0,0) circle (1.5 cm)
defsecondcircle(0: 2 cm) circle (1.5 cm)
defthirdcircle(60:2 cm) circle (1.5 cm)
begintikzpicture
%Define the circles for the Venn diagram for three sets.
draw[fill=white] secondcircle;
draw[fill=white] thirdcircle;
draw[fill=yellow] firstcircle;
% Label the sets.
node[left] at (0, 0) (X);
node[above] at (60: 2 cm) (Y);
node[right] at (0: 2 cm) (Z);
%Color the intersection of all three circles white.
beginscope
clip firstcircle;
clip secondcircle;
draw[fill=white] thirdcircle;
endscope
%Draw the circles.
draw firstcircle;
draw secondcircle;
draw thirdcircle;
endtikzpicture
which produces the diagram

New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 8 hours ago
New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 8 hours ago
N. F. TaussigN. F. Taussig
1515 bronze badges
1515 bronze badges
New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
N. F. Taussig is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
add a comment
|
Just for fun!
documentclass[border=10pt,pstricks]standalone
begindocument
beginpspicture(-3,-4)(6,6)
psclip[linestyle=none]%
pscircle[fillstyle=solid,fillcolor=pink](0,0)3
psclip%
pscircle[fillstyle=solid,fillcolor=pink](3;60)3
pscircle[fillstyle=solid,fillcolor=white](3,0)3
endpsclip
endpsclip
pscircle(0,0)3 rput(-1.5,-0.5)$X setminus (Y cap Z)$
pscircle(3,0)3 rput(1.5,3.5)$Y$
pscircle(3;60)3 rput(3.5,-0.5)$Z$
endpspicture
enddocument

Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
add a comment
|
Just for fun!
documentclass[border=10pt,pstricks]standalone
begindocument
beginpspicture(-3,-4)(6,6)
psclip[linestyle=none]%
pscircle[fillstyle=solid,fillcolor=pink](0,0)3
psclip%
pscircle[fillstyle=solid,fillcolor=pink](3;60)3
pscircle[fillstyle=solid,fillcolor=white](3,0)3
endpsclip
endpsclip
pscircle(0,0)3 rput(-1.5,-0.5)$X setminus (Y cap Z)$
pscircle(3,0)3 rput(1.5,3.5)$Y$
pscircle(3;60)3 rput(3.5,-0.5)$Z$
endpspicture
enddocument

Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
add a comment
|
Just for fun!
documentclass[border=10pt,pstricks]standalone
begindocument
beginpspicture(-3,-4)(6,6)
psclip[linestyle=none]%
pscircle[fillstyle=solid,fillcolor=pink](0,0)3
psclip%
pscircle[fillstyle=solid,fillcolor=pink](3;60)3
pscircle[fillstyle=solid,fillcolor=white](3,0)3
endpsclip
endpsclip
pscircle(0,0)3 rput(-1.5,-0.5)$X setminus (Y cap Z)$
pscircle(3,0)3 rput(1.5,3.5)$Y$
pscircle(3;60)3 rput(3.5,-0.5)$Z$
endpspicture
enddocument

Just for fun!
documentclass[border=10pt,pstricks]standalone
begindocument
beginpspicture(-3,-4)(6,6)
psclip[linestyle=none]%
pscircle[fillstyle=solid,fillcolor=pink](0,0)3
psclip%
pscircle[fillstyle=solid,fillcolor=pink](3;60)3
pscircle[fillstyle=solid,fillcolor=white](3,0)3
endpsclip
endpsclip
pscircle(0,0)3 rput(-1.5,-0.5)$X setminus (Y cap Z)$
pscircle(3,0)3 rput(1.5,3.5)$Y$
pscircle(3;60)3 rput(3.5,-0.5)$Z$
endpspicture
enddocument

edited 8 hours ago
answered 8 hours ago
chishjmutoji 2chishjmutoji 2
16810 bronze badges
16810 bronze badges
Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
add a comment
|
Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
Very nice and I have give you a positive score. Can you edit, please, your code to have Y in mathmode (i.e. $Y$)? Thank you.
– Sebastiano
8 hours ago
add a comment
|
There is a package that specializes on Venn diagrams: venndiagram. One needs to "hack" it a bit since the intersection you are after seems not be in the predefined set, but this is what setpostvennhook is for. This hack defines the interiors and the contours of the circles. They have the names A, B and C, but their labels can be set to X, Y and Z, say.
documentclass[border=10pt]standalone
usepackagevenndiagram
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius]
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
fillA
setpostvennhook
clip[interior=B];
fill[white,interior=C];
draw[contour=A];
endvenndiagram3sets
enddocument

ADDENDUM: Since this is a repeating theme, I am trying to collect some standard tricks here, and also add some stuff to the venndiagram repertoire.
- The
reverse cliptrick allows one to clip on everything outside a given path. - The
even odd cliptrick allows one to apply theeven odd ruleto clips. - I added the styles
interior of, which produce a path that contains the interior of either A, B, or C,contour ofwhich allows one to redraw the contour of either A, B, or C, andcommon of, which allows one to retrieve the intersection of two of the sets. The latter requires thecalclibrary.
Using these tricks, one can avoid overpainting anything in white. We first clip on everything outside the intersection of B and C,
clip[common of=B and C,reverse clip];
and then fill the interior of A,
fill[VennShade,interior of=A];
Complete MWE. (Notice that some care is taken not to add any hard coded distances, the idea being that you produce several diagrams and have common settings.)
documentclass[border=10pt]standalone
usepackagevenndiagram
usetikzlibrarycalc,backgrounds
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
circle[radius=@venn@radius],
midpoint of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
,
common of/.style args=#1 and #2insert path=
let p1=($(csname @venn@#2xendcsname,csname @venn@#2yendcsname)-(csname @venn@#1xendcsname,csname @venn@#1yendcsname)$),
n1=veclen(y1,x1)/2,n2=sqrt(@venn@radius*@venn@radius-n1*n1),
n3=atan2(y1,x1),n4=atan2(n2,n1) in
($(csname @venn@#1xendcsname,csname @venn@#1yendcsname)+(n3+n4:@venn@radius)$)
arc(n3+n4:n3-n4:@venn@radius) arc(n3+180+n4:n3+180-n4:@venn@radius)
-- cycle
%pgfextratypeoutn2,n3,n4,@venn@radius
,
reverse clip/.style=insert path=
(@venn@w,@venn@h) -,
even odd clip/.code=% https://tex.stackexchange.com/a/76216
pgfseteorule
defVennShade@venn@shade
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
setpostvennhook
beginscope[on background layer]
clip[common of=B and C,reverse clip];
fill[VennShade,interior of=A];
endscope
endvenndiagram3sets
enddocument

add a comment
|
There is a package that specializes on Venn diagrams: venndiagram. One needs to "hack" it a bit since the intersection you are after seems not be in the predefined set, but this is what setpostvennhook is for. This hack defines the interiors and the contours of the circles. They have the names A, B and C, but their labels can be set to X, Y and Z, say.
documentclass[border=10pt]standalone
usepackagevenndiagram
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius]
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
fillA
setpostvennhook
clip[interior=B];
fill[white,interior=C];
draw[contour=A];
endvenndiagram3sets
enddocument

ADDENDUM: Since this is a repeating theme, I am trying to collect some standard tricks here, and also add some stuff to the venndiagram repertoire.
- The
reverse cliptrick allows one to clip on everything outside a given path. - The
even odd cliptrick allows one to apply theeven odd ruleto clips. - I added the styles
interior of, which produce a path that contains the interior of either A, B, or C,contour ofwhich allows one to redraw the contour of either A, B, or C, andcommon of, which allows one to retrieve the intersection of two of the sets. The latter requires thecalclibrary.
Using these tricks, one can avoid overpainting anything in white. We first clip on everything outside the intersection of B and C,
clip[common of=B and C,reverse clip];
and then fill the interior of A,
fill[VennShade,interior of=A];
Complete MWE. (Notice that some care is taken not to add any hard coded distances, the idea being that you produce several diagrams and have common settings.)
documentclass[border=10pt]standalone
usepackagevenndiagram
usetikzlibrarycalc,backgrounds
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
circle[radius=@venn@radius],
midpoint of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
,
common of/.style args=#1 and #2insert path=
let p1=($(csname @venn@#2xendcsname,csname @venn@#2yendcsname)-(csname @venn@#1xendcsname,csname @venn@#1yendcsname)$),
n1=veclen(y1,x1)/2,n2=sqrt(@venn@radius*@venn@radius-n1*n1),
n3=atan2(y1,x1),n4=atan2(n2,n1) in
($(csname @venn@#1xendcsname,csname @venn@#1yendcsname)+(n3+n4:@venn@radius)$)
arc(n3+n4:n3-n4:@venn@radius) arc(n3+180+n4:n3+180-n4:@venn@radius)
-- cycle
%pgfextratypeoutn2,n3,n4,@venn@radius
,
reverse clip/.style=insert path=
(@venn@w,@venn@h) -,
even odd clip/.code=% https://tex.stackexchange.com/a/76216
pgfseteorule
defVennShade@venn@shade
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
setpostvennhook
beginscope[on background layer]
clip[common of=B and C,reverse clip];
fill[VennShade,interior of=A];
endscope
endvenndiagram3sets
enddocument

add a comment
|
There is a package that specializes on Venn diagrams: venndiagram. One needs to "hack" it a bit since the intersection you are after seems not be in the predefined set, but this is what setpostvennhook is for. This hack defines the interiors and the contours of the circles. They have the names A, B and C, but their labels can be set to X, Y and Z, say.
documentclass[border=10pt]standalone
usepackagevenndiagram
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius]
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
fillA
setpostvennhook
clip[interior=B];
fill[white,interior=C];
draw[contour=A];
endvenndiagram3sets
enddocument

ADDENDUM: Since this is a repeating theme, I am trying to collect some standard tricks here, and also add some stuff to the venndiagram repertoire.
- The
reverse cliptrick allows one to clip on everything outside a given path. - The
even odd cliptrick allows one to apply theeven odd ruleto clips. - I added the styles
interior of, which produce a path that contains the interior of either A, B, or C,contour ofwhich allows one to redraw the contour of either A, B, or C, andcommon of, which allows one to retrieve the intersection of two of the sets. The latter requires thecalclibrary.
Using these tricks, one can avoid overpainting anything in white. We first clip on everything outside the intersection of B and C,
clip[common of=B and C,reverse clip];
and then fill the interior of A,
fill[VennShade,interior of=A];
Complete MWE. (Notice that some care is taken not to add any hard coded distances, the idea being that you produce several diagrams and have common settings.)
documentclass[border=10pt]standalone
usepackagevenndiagram
usetikzlibrarycalc,backgrounds
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
circle[radius=@venn@radius],
midpoint of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
,
common of/.style args=#1 and #2insert path=
let p1=($(csname @venn@#2xendcsname,csname @venn@#2yendcsname)-(csname @venn@#1xendcsname,csname @venn@#1yendcsname)$),
n1=veclen(y1,x1)/2,n2=sqrt(@venn@radius*@venn@radius-n1*n1),
n3=atan2(y1,x1),n4=atan2(n2,n1) in
($(csname @venn@#1xendcsname,csname @venn@#1yendcsname)+(n3+n4:@venn@radius)$)
arc(n3+n4:n3-n4:@venn@radius) arc(n3+180+n4:n3+180-n4:@venn@radius)
-- cycle
%pgfextratypeoutn2,n3,n4,@venn@radius
,
reverse clip/.style=insert path=
(@venn@w,@venn@h) -,
even odd clip/.code=% https://tex.stackexchange.com/a/76216
pgfseteorule
defVennShade@venn@shade
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
setpostvennhook
beginscope[on background layer]
clip[common of=B and C,reverse clip];
fill[VennShade,interior of=A];
endscope
endvenndiagram3sets
enddocument

There is a package that specializes on Venn diagrams: venndiagram. One needs to "hack" it a bit since the intersection you are after seems not be in the predefined set, but this is what setpostvennhook is for. This hack defines the interiors and the contours of the circles. They have the names A, B and C, but their labels can be set to X, Y and Z, say.
documentclass[border=10pt]standalone
usepackagevenndiagram
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius]
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
fillA
setpostvennhook
clip[interior=B];
fill[white,interior=C];
draw[contour=A];
endvenndiagram3sets
enddocument

ADDENDUM: Since this is a repeating theme, I am trying to collect some standard tricks here, and also add some stuff to the venndiagram repertoire.
- The
reverse cliptrick allows one to clip on everything outside a given path. - The
even odd cliptrick allows one to apply theeven odd ruleto clips. - I added the styles
interior of, which produce a path that contains the interior of either A, B, or C,contour ofwhich allows one to redraw the contour of either A, B, or C, andcommon of, which allows one to retrieve the intersection of two of the sets. The latter requires thecalclibrary.
Using these tricks, one can avoid overpainting anything in white. We first clip on everything outside the intersection of B and C,
clip[common of=B and C,reverse clip];
and then fill the interior of A,
fill[VennShade,interior of=A];
Complete MWE. (Notice that some care is taken not to add any hard coded distances, the idea being that you produce several diagrams and have common settings.)
documentclass[border=10pt]standalone
usepackagevenndiagram
usetikzlibrarycalc,backgrounds
makeatletter% https://tex.stackexchange.com/a/499947
tikzsetinterior of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname) circle[radius=@venn@radius-pgflinewidth/2],
contour of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
circle[radius=@venn@radius],
midpoint of/.style=insert path=
(csname @venn@#1xendcsname,csname @venn@#1yendcsname)
,
common of/.style args=#1 and #2insert path=
let p1=($(csname @venn@#2xendcsname,csname @venn@#2yendcsname)-(csname @venn@#1xendcsname,csname @venn@#1yendcsname)$),
n1=veclen(y1,x1)/2,n2=sqrt(@venn@radius*@venn@radius-n1*n1),
n3=atan2(y1,x1),n4=atan2(n2,n1) in
($(csname @venn@#1xendcsname,csname @venn@#1yendcsname)+(n3+n4:@venn@radius)$)
arc(n3+n4:n3-n4:@venn@radius) arc(n3+180+n4:n3+180-n4:@venn@radius)
-- cycle
%pgfextratypeoutn2,n3,n4,@venn@radius
,
reverse clip/.style=insert path=
(@venn@w,@venn@h) -,
even odd clip/.code=% https://tex.stackexchange.com/a/76216
pgfseteorule
defVennShade@venn@shade
makeatother
begindocument
beginvenndiagram3sets[labelA=$X$,labelB=$Y$,labelC=$Z$]
setpostvennhook
beginscope[on background layer]
clip[common of=B and C,reverse clip];
fill[VennShade,interior of=A];
endscope
endvenndiagram3sets
enddocument

edited 4 hours ago
answered 8 hours ago
Schrödinger's catSchrödinger's cat
6,92511 silver badges22 bronze badges
6,92511 silver badges22 bronze badges
add a comment
|
add a comment
|
Another solution with venndiagram:
documentclass[svgnames, tikz, border=6pt]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagelmodern, amssymb, nccmath
usepackagevenndiagram
begindocument
beginvenndiagram3sets[radius=1.5cm, overlap=1.2cm]%
setkeysvennshade=Lavender, labelA=, labelB=
fillOnlyAfillACapBNotCfillACapCNotB
setkeysvennshade=WhiteSmoke!80!Thistle, labelA=, labelB=
fillBCapC
setpostvennhook
%
draw (labelA) ++(180:1.1cm) node$A$;
draw (labelB) ++(0:1.1cm) node$B$;
draw (labelABC) ++(-20:0.6cm) node[text=MediumVioletRed]$medmath B ∩ C$;
draw (labelA) ++(-100:1.2cm) node[text=NavyBlue]$medmathAsmallsetminus(Bcap C)$;
%
endvenndiagram3sets
enddocument

All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax fornode$colorMediumVioletRedmedmath B ∩ C$isnode[text=MediumVioletRed]$medmath B ∩ C$.
– Schrödinger's cat
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
add a comment
|
Another solution with venndiagram:
documentclass[svgnames, tikz, border=6pt]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagelmodern, amssymb, nccmath
usepackagevenndiagram
begindocument
beginvenndiagram3sets[radius=1.5cm, overlap=1.2cm]%
setkeysvennshade=Lavender, labelA=, labelB=
fillOnlyAfillACapBNotCfillACapCNotB
setkeysvennshade=WhiteSmoke!80!Thistle, labelA=, labelB=
fillBCapC
setpostvennhook
%
draw (labelA) ++(180:1.1cm) node$A$;
draw (labelB) ++(0:1.1cm) node$B$;
draw (labelABC) ++(-20:0.6cm) node[text=MediumVioletRed]$medmath B ∩ C$;
draw (labelA) ++(-100:1.2cm) node[text=NavyBlue]$medmathAsmallsetminus(Bcap C)$;
%
endvenndiagram3sets
enddocument

All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax fornode$colorMediumVioletRedmedmath B ∩ C$isnode[text=MediumVioletRed]$medmath B ∩ C$.
– Schrödinger's cat
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
add a comment
|
Another solution with venndiagram:
documentclass[svgnames, tikz, border=6pt]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagelmodern, amssymb, nccmath
usepackagevenndiagram
begindocument
beginvenndiagram3sets[radius=1.5cm, overlap=1.2cm]%
setkeysvennshade=Lavender, labelA=, labelB=
fillOnlyAfillACapBNotCfillACapCNotB
setkeysvennshade=WhiteSmoke!80!Thistle, labelA=, labelB=
fillBCapC
setpostvennhook
%
draw (labelA) ++(180:1.1cm) node$A$;
draw (labelB) ++(0:1.1cm) node$B$;
draw (labelABC) ++(-20:0.6cm) node[text=MediumVioletRed]$medmath B ∩ C$;
draw (labelA) ++(-100:1.2cm) node[text=NavyBlue]$medmathAsmallsetminus(Bcap C)$;
%
endvenndiagram3sets
enddocument

Another solution with venndiagram:
documentclass[svgnames, tikz, border=6pt]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagelmodern, amssymb, nccmath
usepackagevenndiagram
begindocument
beginvenndiagram3sets[radius=1.5cm, overlap=1.2cm]%
setkeysvennshade=Lavender, labelA=, labelB=
fillOnlyAfillACapBNotCfillACapCNotB
setkeysvennshade=WhiteSmoke!80!Thistle, labelA=, labelB=
fillBCapC
setpostvennhook
%
draw (labelA) ++(180:1.1cm) node$A$;
draw (labelB) ++(0:1.1cm) node$B$;
draw (labelABC) ++(-20:0.6cm) node[text=MediumVioletRed]$medmath B ∩ C$;
draw (labelA) ++(-100:1.2cm) node[text=NavyBlue]$medmathAsmallsetminus(Bcap C)$;
%
endvenndiagram3sets
enddocument

edited 5 hours ago
answered 5 hours ago
BernardBernard
191k8 gold badges86 silver badges226 bronze badges
191k8 gold badges86 silver badges226 bronze badges
All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax fornode$colorMediumVioletRedmedmath B ∩ C$isnode[text=MediumVioletRed]$medmath B ∩ C$.
– Schrödinger's cat
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
add a comment
|
All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax fornode$colorMediumVioletRedmedmath B ∩ C$isnode[text=MediumVioletRed]$medmath B ∩ C$.
– Schrödinger's cat
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax for
node$colorMediumVioletRedmedmath B ∩ C$ is node[text=MediumVioletRed]$medmath B ∩ C$.– Schrödinger's cat
5 hours ago
All the distances are hard coded, so if the user ever decides to change the settings of the Venn diagram, they have to readjust them. Please note also that the "proper" syntax for
node$colorMediumVioletRedmedmath B ∩ C$ is node[text=MediumVioletRed]$medmath B ∩ C$.– Schrödinger's cat
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
I thought it didn't work in mathmode… I'll fix it readily.
– Bernard
5 hours ago
add a comment
|
This is usual clip of TikZ as Taussig did above. Maybe I am a bit difficult when considering plainess and flexibility of the TikZ code.

documentclass[tikz,border=5mm]standalone
begindocument
begintikzpicture
defr1.5 defd1
deffirstC(90:d) circle(r)
defsecondC(-30:d) circle(r)
defthirdC(210:d) circle(r)
fill[magenta!30] firstC;
beginscope
clip firstC;
clip secondC;
fill[white] thirdC;
endscope
draw firstC secondC thirdC;
path
(90:1.2*d) node[magenta,scale=.6]$Asetminus (Bcap C)$
(90:2*d) node$A$
(210:2*d) node$B$
(-30:2*d) node$C$;
endtikzpicture
enddocument
Here are translation to Asymptote code (exactly the same picture).
unitsize(1cm);
real r=1.5,d=1;
pair A=d*dir(90),B=d*dir(210),C=d*dir(-30);
path firstC=circle(A,r);
path secondC=circle(B,r);
path thirdC=circle(C,r);
fill(firstC,.3magenta+.7white);
picture BcapC;
fill(BcapC,thirdC,white);
clip(BcapC,firstC);
clip(BcapC,secondC);
add(BcapC);
draw(firstC^^secondC^^thirdC);
label("$A$",2A);
label("$B$",2B);
label("$C$",2C);
label((scale(.6))*"$Asetminus (Bcap C)$",1.2A,magenta);
add(bbox(5mm),Fill(white));
add a comment
|
This is usual clip of TikZ as Taussig did above. Maybe I am a bit difficult when considering plainess and flexibility of the TikZ code.

documentclass[tikz,border=5mm]standalone
begindocument
begintikzpicture
defr1.5 defd1
deffirstC(90:d) circle(r)
defsecondC(-30:d) circle(r)
defthirdC(210:d) circle(r)
fill[magenta!30] firstC;
beginscope
clip firstC;
clip secondC;
fill[white] thirdC;
endscope
draw firstC secondC thirdC;
path
(90:1.2*d) node[magenta,scale=.6]$Asetminus (Bcap C)$
(90:2*d) node$A$
(210:2*d) node$B$
(-30:2*d) node$C$;
endtikzpicture
enddocument
Here are translation to Asymptote code (exactly the same picture).
unitsize(1cm);
real r=1.5,d=1;
pair A=d*dir(90),B=d*dir(210),C=d*dir(-30);
path firstC=circle(A,r);
path secondC=circle(B,r);
path thirdC=circle(C,r);
fill(firstC,.3magenta+.7white);
picture BcapC;
fill(BcapC,thirdC,white);
clip(BcapC,firstC);
clip(BcapC,secondC);
add(BcapC);
draw(firstC^^secondC^^thirdC);
label("$A$",2A);
label("$B$",2B);
label("$C$",2C);
label((scale(.6))*"$Asetminus (Bcap C)$",1.2A,magenta);
add(bbox(5mm),Fill(white));
add a comment
|
This is usual clip of TikZ as Taussig did above. Maybe I am a bit difficult when considering plainess and flexibility of the TikZ code.

documentclass[tikz,border=5mm]standalone
begindocument
begintikzpicture
defr1.5 defd1
deffirstC(90:d) circle(r)
defsecondC(-30:d) circle(r)
defthirdC(210:d) circle(r)
fill[magenta!30] firstC;
beginscope
clip firstC;
clip secondC;
fill[white] thirdC;
endscope
draw firstC secondC thirdC;
path
(90:1.2*d) node[magenta,scale=.6]$Asetminus (Bcap C)$
(90:2*d) node$A$
(210:2*d) node$B$
(-30:2*d) node$C$;
endtikzpicture
enddocument
Here are translation to Asymptote code (exactly the same picture).
unitsize(1cm);
real r=1.5,d=1;
pair A=d*dir(90),B=d*dir(210),C=d*dir(-30);
path firstC=circle(A,r);
path secondC=circle(B,r);
path thirdC=circle(C,r);
fill(firstC,.3magenta+.7white);
picture BcapC;
fill(BcapC,thirdC,white);
clip(BcapC,firstC);
clip(BcapC,secondC);
add(BcapC);
draw(firstC^^secondC^^thirdC);
label("$A$",2A);
label("$B$",2B);
label("$C$",2C);
label((scale(.6))*"$Asetminus (Bcap C)$",1.2A,magenta);
add(bbox(5mm),Fill(white));
This is usual clip of TikZ as Taussig did above. Maybe I am a bit difficult when considering plainess and flexibility of the TikZ code.

documentclass[tikz,border=5mm]standalone
begindocument
begintikzpicture
defr1.5 defd1
deffirstC(90:d) circle(r)
defsecondC(-30:d) circle(r)
defthirdC(210:d) circle(r)
fill[magenta!30] firstC;
beginscope
clip firstC;
clip secondC;
fill[white] thirdC;
endscope
draw firstC secondC thirdC;
path
(90:1.2*d) node[magenta,scale=.6]$Asetminus (Bcap C)$
(90:2*d) node$A$
(210:2*d) node$B$
(-30:2*d) node$C$;
endtikzpicture
enddocument
Here are translation to Asymptote code (exactly the same picture).
unitsize(1cm);
real r=1.5,d=1;
pair A=d*dir(90),B=d*dir(210),C=d*dir(-30);
path firstC=circle(A,r);
path secondC=circle(B,r);
path thirdC=circle(C,r);
fill(firstC,.3magenta+.7white);
picture BcapC;
fill(BcapC,thirdC,white);
clip(BcapC,firstC);
clip(BcapC,secondC);
add(BcapC);
draw(firstC^^secondC^^thirdC);
label("$A$",2A);
label("$B$",2B);
label("$C$",2C);
label((scale(.6))*"$Asetminus (Bcap C)$",1.2A,magenta);
add(bbox(5mm),Fill(white));
edited 4 hours ago
answered 4 hours ago
Black MildBlack Mild
2,1639 silver badges16 bronze badges
2,1639 silver badges16 bronze badges
add a comment
|
add a comment
|
Andrew Rubner is a new contributor. Be nice, and check out our Code of Conduct.
Andrew Rubner is a new contributor. Be nice, and check out our Code of Conduct.
Andrew Rubner is a new contributor. Be nice, and check out our Code of Conduct.
Andrew Rubner is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f508277%2fhow-to-draw-a-venn-diagram-for-x-y-intersect-z%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown