Venn Diagrams and Patterns
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,0) circle(1.5);
\draw (2,0) circle(1.5);
\node[fill=white,inner sep=1pt,rounded corners,below=3] at (90:1.5) {$A$};
\node[xshift=2cm,below=3] at (90:1.5) {$B$};
\end{tikzpicture}
\end{document}
The output:
EDIT: Here is a proposal with horizontal lines (manually pattern drawn – just for fun):
\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}]
\begin{scope}
\clip (0,0) circle(1.5);
\foreach \x in {-5,-4.95,...,6}
{
\draw[black,yshift=\x cm] (-5,\x) -- (5,\x);
}
\end{scope}
\draw (2,0) circle(1.5);
\draw (0,0) circle(1.5);
\node[fill=white,inner sep=1pt,rounded corners,below=3] at (90:1.5) {$A$};
\node[xshift=2cm,below=3] at (90:1.5) {$B$};
\end{tikzpicture}
\end{document}
Here is the output:
I agree with marmot's comment that the best option is to make the package more flexible (my suggestion would be to replace fill=\@venn@shade
with something like every venn region/.try
). In the meantime, here's a fix that uses a scope to add extra options to the path.
\documentclass{article}
%\url{https://tex.stackexchange.com/q/446941/86}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{venndiagram}
%
\begin{document}
\begin{venndiagram2sets}[shade={},tikzoptions={red}]
\begin{scope}[every path/.append style={pattern=north east lines}]
\fillA
\end{scope}
\end{venndiagram2sets}
\end{document}
The shade={}
is important. It enables filling (since shade=<colour>
becomes fill=<colour>
in the code) but doesn't specify a colour. The point here is that the every path
style is examined first so putting shade=<actual colour>
would override the pattern, while shade=none
would disable it. Only shade={}
enables the pattern without overwriting it.
Update 2018-08-22
Dealing with intersection regions turns out to be a bit tricky due to how clipping works. The following is definitely in the region of a bit of a hack, but it does seem to work. It appends some code to the clip
command which removes the options and turns off any other options. I think this deals with everything that can go bad with passing options to a clipping path.
I've also add a helper command that wraps a venn diagram command in a scope so that this technique works.
\documentclass{article}
%\url{https://tex.stackexchange.com/q/446941/86}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{venndiagram}
%
\newcommand*\wrapscope[1]{%
\expandafter\newcommand\csname o#1\endcsname[1][]{%
\begin{scope}[##1]
\csname #1\endcsname
\end{scope}
}%
}%
\wrapscope{fillA}
\wrapscope{fillACapB}
\makeatletter
\tikzset{
clip/.append code={%
\let\tikz@options=\pgfutil@empty
\tikz@addmode\tikz@mode@fillfalse%
\tikz@addmode\tikz@mode@drawfalse%
\tikz@addmode\tikz@mode@doublefalse%
\tikz@addmode\tikz@mode@boundaryfalse%
\tikz@addmode\tikz@mode@fade@pathfalse%
\tikz@addmode\tikz@mode@fade@scopefalse%
}
}
\makeatother
\begin{document}
\begin{venndiagram2sets}[shade={},tikzoptions={red}]
%\ofillA[every path/.append style={pattern=north east lines}]
\ofillACapB[every path/.append style={pattern=north east lines}]
\end{venndiagram2sets}
\end{document}