Dear Community,
I want to graph some Venn diagrams and highlight some intersection points, as shown on this website: https://verfassungsblog.de/veto-players ... -part-1-2/
I have added the picture of the website I am interested in. I want to highlight point SQ and the point where A and B intersect. However, I only find codes to highlight the intersection areas (but not the points themselves) and to magnify the intersection points (though I am not interested in magnifying such points).
Thank you very much for your support
LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Venn Diagrams and Intersection Points
Venn Diagrams and Intersection Points
- Attachments
-
- VPs.png (118.38 KiB) Viewed 129 times
If you use
tikz
for the drawing, the intersection points can be calculated. You can use the assigned names or choose them yourself.Could you please help me? So far I have just made the following Venn diagram and labeled the point SQ:
[\documentclass{article}
\usepackage{tikz}
\RequirePackage{xkeyval}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\usetikzlibrary{shapes,backgrounds, intersections}
\begin{document}
\begin{tikzpicture}
\begin{scope} [fill opacity = .4]
\draw (-5,5) rectangle (5,-6);
\draw[fill=green, draw = black] (-1.5,1) circle (3);
\draw[fill=blue, draw = black] (1.5,1) circle (3);
\draw[fill=red, draw = black] (0,-2) circle (3);
\begin{scope}
\clip \firstcircle;
\clip \secondcircle;
\draw[fill=white];
\end{scope}
\node at (-4,5.2) {\LARGE\textbf{X}};
\node at (-3,4) {\LARGE\textbf{A}};
\node at (3,4) {\LARGE\textbf{B}};
\node at (-3,-4) {\LARGE\textbf{C}};
\node at (0,0) {\LARGE\textbf{0}};
\node at (0,-1.5) {\small\textbf{SQ}};
\end{scope}
\draw[help lines](-5,5) grid (5,-6);
\end{tikzpicture}
\end{document}][/code]
[\documentclass{article}
\usepackage{tikz}
\RequirePackage{xkeyval}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\usetikzlibrary{shapes,backgrounds, intersections}
\begin{document}
\begin{tikzpicture}
\begin{scope} [fill opacity = .4]
\draw (-5,5) rectangle (5,-6);
\draw[fill=green, draw = black] (-1.5,1) circle (3);
\draw[fill=blue, draw = black] (1.5,1) circle (3);
\draw[fill=red, draw = black] (0,-2) circle (3);
\begin{scope}
\clip \firstcircle;
\clip \secondcircle;
\draw[fill=white];
\end{scope}
\node at (-4,5.2) {\LARGE\textbf{X}};
\node at (-3,4) {\LARGE\textbf{A}};
\node at (3,4) {\LARGE\textbf{B}};
\node at (-3,-4) {\LARGE\textbf{C}};
\node at (0,0) {\LARGE\textbf{0}};
\node at (0,-1.5) {\small\textbf{SQ}};
\end{scope}
\draw[help lines](-5,5) grid (5,-6);
\end{tikzpicture}
\end{document}][/code]
Could you please help me? So far I have just made the following Venn diagram and labeled the point SQ:
[\documentclass{article}
\usepackage{tikz}
\RequirePackage{xkeyval}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\usetikzlibrary{shapes,backgrounds, intersections}
\begin{document}
\begin{tikzpicture}
\begin{scope} [fill opacity = .4]
\draw (-5,5) rectangle (5,-6);
\draw[fill=green, draw = black] (-1.5,1) circle (3);
\draw[fill=blue, draw = black] (1.5,1) circle (3);
\draw[fill=red, draw = black] (0,-2) circle (3);
\begin{scope}
\clip \firstcircle;
\clip \secondcircle;
\draw[fill=white];
\end{scope}
\node at (-4,5.2) {\LARGE\textbf{X}};
\node at (-3,4) {\LARGE\textbf{A}};
\node at (3,4) {\LARGE\textbf{B}};
\node at (-3,-4) {\LARGE\textbf{C}};
\node at (0,0) {\LARGE\textbf{0}};
\node at (0,-1.5) {\small\textbf{SQ}};
\end{scope}
\draw[help lines](-5,5) grid (5,-6);
\end{tikzpicture}
\end{document}
[\documentclass{article}
\usepackage{tikz}
\RequirePackage{xkeyval}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\usetikzlibrary{shapes,backgrounds, intersections}
\begin{document}
\begin{tikzpicture}
\begin{scope} [fill opacity = .4]
\draw (-5,5) rectangle (5,-6);
\draw[fill=green, draw = black] (-1.5,1) circle (3);
\draw[fill=blue, draw = black] (1.5,1) circle (3);
\draw[fill=red, draw = black] (0,-2) circle (3);
\begin{scope}
\clip \firstcircle;
\clip \secondcircle;
\draw[fill=white];
\end{scope}
\node at (-4,5.2) {\LARGE\textbf{X}};
\node at (-3,4) {\LARGE\textbf{A}};
\node at (3,4) {\LARGE\textbf{B}};
\node at (-3,-4) {\LARGE\textbf{C}};
\node at (0,0) {\LARGE\textbf{0}};
\node at (0,-1.5) {\small\textbf{SQ}};
\end{scope}
\draw[help lines](-5,5) grid (5,-6);
\end{tikzpicture}
\end{document}
Your code errs out (neither \firstcircle nor \secondcircle is defined).
Perhaps something like this?
BTW: you should refrain from using
KR
Rainer
Perhaps something like this?
\documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture} \begin{scope} [fill opacity = .4] \draw (-5,5) rectangle (5,-6); % name the paths: \path[name path=A, draw, fill=green] (-1.5,1) circle (3) node(NA){}; \path[name path=B, draw, fill=blue] (1.5,1) circle (3) node(NB){}; \path[name path=C, draw, fill=red] (0,-2) circle (3) node(NC){}; \begin{scope}[fill opacity=1]% punch out the intersecting area of cicles A and B: \clip (NB) circle (2.99297);% half the line width smaller than the circle's radius % to keep the circle's line (B) intact. % (= 3cm - 0.2pt * 2.54cm/in / 72.27pt/in) \fill[white] (NA) circle (2.99297);% same here for circle A \end{scope}% end the scope to be able to draw something outside its clip area % get the intersection points between circles A and B: \path[name intersections={of=A and B}]; \begin{scope}[fill opacity=1]% put some solid dots at the intersecting points: \fill (intersection-1) circle (3pt) node[above]{$y$}; \fill (intersection-2) circle (3pt) node[below=3pt]{SQ}; \end{scope} \node at (-4,5.2) {\LARGE\textbf{X}}; \node at (-3,4) {\LARGE\textbf{A}}; \node at (3,4) {\LARGE\textbf{B}}; \node at (-3,-4) {\LARGE\textbf{C}}; \node at (0,0) {\LARGE\textbf{0}}; \node at (0,-1.5) {\small\textbf{SQ}}; \end{scope} \draw[help lines](-5,5) grid (5,-6); \end{tikzpicture} \end{document}
BTW: you should refrain from using
\RequirePackage
inside your document. That's more suited for packages / classes. Besides, \usepackage
is even less to type 
KR
Rainer
Return to “Graphics, Figures & Tables”
Who is online
Users browsing this forum: No registered users and 7 guests