Remove intersect line for one circle using venndiagram2sets
The venndiagram
package is very well written and hence easy to customize. I added a style interior B
(and also interior A
) that can be used as follows:
\fill[white,interior B];
This fills the right circle white. One could add several other similar styles, if needed.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning}
\usepackage{venndiagram}
\usepackage{float}
\usepackage{showframe}
\makeatletter
\tikzset{interior A/.style={insert path={
(\@venn@Ax,\@venn@Ay) circle[radius=\@venn@radius-\pgflinewidth/2]}},
interior B/.style={insert path={
(\@venn@Bx,\@venn@By) circle[radius=\@venn@radius-\pgflinewidth/2]}}}
\makeatother
\begin{document}
\begin{figure}[H]
\centering
\begin{minipage}[t]{0.45\textwidth}
\begin{venndiagram2sets}[radius=1.3cm,labelA=,labelB=]
\fillOnlyA
\setpostvennhook
{
\fill[white,interior B];
\draw (labelA) node[below=6ex] {A\textbackslash B};
\draw (labelB) node[below=6ex] {B};
}
\end{venndiagram2sets}
\caption{$\mathbf{A}$\textbackslash$\mathbf{B}$}
\label{fig:venncup}
\end{minipage}
\end{figure}
\end{document}
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,draw=black] (0,0) circle (2cm);
\node at (0,0){A\textbackslash B};
\fill[white,draw=black] (3cm,0) circle (2cm);
\node at (3cm,0) {B};
\end{tikzpicture}
\caption{$\mathbf{A}$\textbackslash$\mathbf{B}$}
\label{fig:venncup}
\end{minipage}
\end{figure}
\end{document}