1

I drew a map which sends everything in the domain apart from i to a fixed point r and sends i to 2. However, I couldn't make curved arrows as well as shaded area as appears in the attachment below. Could you please help me. This is my attempt:

\documentclass[10pt]{article}
\usepackage{geometry}% <-- added, 
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{mathrsfs}

\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}

\tikzset{graph-1/.style = {
  >=stealth,
  x=0.37cm, y=0.37cm }
  }% end of tikzset


\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}[graph-1]

 \foreach \x/\label in {0/\scriptstyle1}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=above:{$\label$}, left=-1.7cm] at (\x,1.5) (t\x) {};

  \foreach \x/\label in {0/\scriptstyle1, 2/\scriptstyle2}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=below:{$\label$},left=-1.7cm] at (\x,-1.5) (b\x) {};

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\foreach \x/\label in {8/\scriptstyle i}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=above:{$\label$}] at (\x,1.5) (t\x) {};

  \foreach \x/\label in {10/\scriptstyle r}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=below:{$\label$}] at (\x,-1.5) (b\x) {};

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
    \foreach \x/\label in {16/\scriptstyle n}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=above:{$\label$}, right=.0cm] at (\x,1.5) (t\x) {};

    \foreach \x/\label in {16/\scriptstyle n}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=below:{$\label$},right=.0cm] at (\x,-1.5) (b\x) {};
  %********************************************
\path[draw,  dotted] (t8) edge (t16);
\path[draw,  dotted] (t0) edge (t8);
    %*****************************************
  \draw[uuuuuu,->] (t0) -- (b10);
  \draw[uuuuuu,->] (t8) -- (b2);
   \draw[uuuuuu,->] (t16) -- (b10);
   %******************************************
    \node[left] at (3,0) {$\sigma=$};
    \end{tikzpicture}
    \hfil

   \end{figure}
    \end{document}

enter image description here

1

I only focus on the "fill between curved arrows" part in my answer. You can conveniently draw such arrows with the to[in=x,out=y] syntax, where x and y are the impact and outgoing angles. (In addition, there is a looseness parameter, but that's maybe not needed here.) This allows you to draw the arrows, and to define the path bounding the area that is to be filled. One has to be a bit careful because nodes are extended objects. So I added

\begin{scope}[on background layer]
    \path[fill=red!20]  (t0) to[out=-45,in=135] (b10.135)--(b10.45) to[out=45,in=-135] (t16) -- cycle;
\end{scope}

to your code, which requires the backgrounds library, since presumably you want the filling on the background. The (b10.135)--(b10.45) bit is because the b10 node is an extended object.

enter image description here

That's the complete code:

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows,backgrounds}
\usepackage{mathrsfs}

\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}

\tikzset{graph-1/.style = {
  >=stealth,
  x=0.37cm, y=0.37cm }
  }% end of tikzset


\begin{document}
\begin{tikzpicture}[graph-1]
\foreach \x/\label in {0/\scriptstyle1}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=above:{$\label$}, left=-1.7cm] at (\x,1.5) (t\x) {};

\foreach \x/\label in {0/\scriptstyle1, 2/\scriptstyle2}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=below:{$\label$},left=-1.7cm] at (\x,-1.5) (b\x) {};

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\foreach \x/\label in {8/\scriptstyle i}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=above:{$\label$}] at (\x,1.5) (t\x) {};

  \foreach \x/\label in {10/\scriptstyle r}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=below:{$\label$}] at (\x,-1.5) (b\x) {};

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
    \foreach \x/\label in {16/\scriptstyle n}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=above:{$\label$}, right=.0cm] at (\x,1.5) (t\x) {};

    \foreach \x/\label in {16/\scriptstyle n}
  \node[fill=uuuuuu,inner sep=1.3pt,circle,label=below:{$\label$},right=.0cm] at (\x,-1.5) (b\x) {};
%********************************************
\path[draw,  dotted] (t8) edge (t16);
\path[draw,  dotted] (t0) edge (t8);
%*****************************************
\draw[uuuuuu,->] (t0) to[out=-45,in=135] (b10);
\draw[uuuuuu,->] (t8) to[out=-90,in=90] (b2);
\draw[uuuuuu,->] (t16) to[out=-135,in=45] (b10);
\begin{scope}[on background layer]
\path[fill=red!20]  (t0) to[out=-45,in=135] (b10.135)--(b10.45) to[out=45,in=-135] (t16) -- cycle;
\end{scope}
%******************************************
\node[left] at (3,0) {$\sigma=$};
\end{tikzpicture}
\end{document}
  • Dear Marmot! thanks a lot. I don't even know how to express my appreciation to YOU in words. – Mal JA Jun 27 '18 at 2:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.