1

In the tikzpicture below, I would like to shade the area between the two paths labeled p and q. This is similar to Filling region between two \draw Tikz but I have not been able to adapt the answer there to my needs.

\documentclass{standalone}
\usepackage{tikz}\usetikzlibrary{decorations.pathmorphing,arrows,decorations.text,intersections,patterns}
\tikzset{snake it/.style={decorate, decoration=snake, -> ,>=stealth}}
\begin{document}
  \begin{tikzpicture}   
   \draw[name path = eli] (0,0) ellipse (5 and 2) ;
   \node[label=right:$X$] at (5,0) {};
   \node[label=left:$x$, circle] (x) at (-3,0) {};
   \fill[black, opacity = 1,] (x) circle (2pt);
   \node[label=right:$y$, circle] (y) at (2,1) {};
   \fill[black, opacity = 1,] (y) circle (2pt);
   \path (x) edge 
              [name path=qq, bend right=60, snake it] 
              node[swap,label=below:$q$] {}
              (y) ;
   \path (x) edge 
              [name path=pp, bend left=30, snake it, ->] 
              node[swap,label=above:$p$] {}
              (y) ;
   \fill[pattern color = gray, pattern = north east lines, opacity=0.8] (pp)  (0,0) (qq);
  \end{tikzpicture}
\end{document}
Horst
  • 11

1 Answers1

3

A hacky solution :

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,patterns}
\tikzset{snake it/.style={decorate, decoration=snake, -> ,>=stealth}}
\begin{document}
  \begin{tikzpicture}
    \draw(0,0) ellipse (5 and 2);
    \node[label=right:$X$] at (5,0) {};
    \node[label=left:$x$, circle,] (x) at (-3,0) {};
    \node[label=right:$y$, circle] (y) at (2,1) {};
    \fill[pattern color = gray!80, pattern = north east lines] (x.center) to[bend right=45] (y.center) to[bend right=23] cycle;
    \fill[preaction={draw=white,line width=4pt},black] (x) circle (2pt);
    \fill[preaction={draw=white,line width=4pt},black] (y) circle (2pt);
    \path (x) edge[preaction={pattern color = gray!80, pattern = north east lines}, bend right=60, snake it] node[swap,label=below:$q$] {}(y);
    \path (x) edge[preaction={pattern color = gray!80, pattern = north east lines}, bend left=30, snake it] node[swap,label=above:$p$] {}(y);
  \end{tikzpicture}
\end{document}

enter image description here

Kpym
  • 23,002