# moving arrows on a tikz diagram

I am new to tikz and need some help changing a diagram i had some help making. In the old diagram the mappings look like this:

p   \
\x_____y
/
pbar/


i.e. the two elements p,pbar are mapped to the same element by the first map, x, and the second map just passes them along to y. I want to make a new one where they look like this:

p   _____   x\
\y
/
pbar_____xbar/


i.e. the two elements p,pbar are mapped to different elements by the first map, x, and xbar, but the second map takes them both to y. I want to make a new one where they look like this:

The code for the old diagram is:

\documentclass[a4paper,11pt,twoside]{report}
\usepackage{mathrsfs}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,calc,arrows.meta,shapes,fit}
\usetikzlibrary{arrows,automata}
\begin{document}
\begin{tikzpicture}[loose/.style={inner sep=.7em}, oval/.style={ellipse,draw}]
\newcommand{\p}{\mathbf{p}}
\newcommand{\x}{\mathbf{x}}
\node(p){$\p$};
\node[below=1 of p](pb){$\bar \p$};
\node[right=4 of $(p)!0.5!(pb)$](x1){$\x(\cdot;\p,I)$};
\node[right =4 of x1](y){$y(\cdot;\p,I)$}; \def\ovalwidth{0.8}%Just used for the left one, adjust to make roughly match the others which are already wide
\def\ovalheight{0.4}%excess height, all will get the same height.
\coordinate(ovaltop) at ($(p.north)+(0,\ovalheight)$);
\coordinate(ovalbot) at ($(pb.south)-(0,\ovalheight)$); \node[oval,inner sep=2pt,fit={(ovaltop)($(pb)+(\ovalwidth,0)$)($(pb)-(\ovalwidth,0)$)(ovalbot)},label=$\Omega$]{};
\node[oval,inner
sep=2pt,fit={(x1)(x1|-ovaltop)(x1|-ovalbot)},label=$\mathscr{F}_\Pi(I)\subset\mathscr{F}_\Pi$]{};
\node[oval,inner
sep=2pt,fit={(y)(y|-ovaltop)(y|-ovalbot)},label=$\mathscr{G}_\Pi(I)\subset\mathscr{G}_\Sigma$]{};
\draw[-Latex] (p) -- node [above,loose]{$X_{\Pi I}(\p)$} (x1);
\draw[-Latex] (pb) -- node [below,loose]{$X_{\Pi I}(\bar\p)$} (x1); \draw[-Latex] (x1) -- node [above,loose]{$Y_\Sigma(\x(\cdot;\p,I))$} (y);
\end{tikzpicture}
\end{document}


it contains lots of extra elements like ovals and labels for the arrows. Please leave the ovals as they are (i.e. leftmost one containing ps middleone containing xs and rightmost one containing y), and I'm confident enough to label the new arrows myself.

if its not too much of a hassle could you also explain your code a little more than you normally would - I'm hopeful that I'll soon be able to make these without help.

\documentclass[a4paper,11pt,twoside]{report}
\usepackage{mathrsfs}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,arrows.meta,shapes,fit}
\begin{document}
\begin{tikzpicture}[loose/.style={inner sep=.7em}, oval/.style={ellipse,draw}]
\newcommand{\p}{\mathbf{p}}
\newcommand{\x}{\mathbf{x}}
\node(p){$\p$};
\node[below=1 of p](pb){$\bar \p$};
\node[right=3 of p](x0){$\x$};
\node[right=3 of pb](x0b){$\bar\x$};
\node[right=3 of $(x0)!0.5!(x0b)$](x1){$\x(\cdot;\p,I)$};
\node[right=3 of x1](y){$y(\cdot;\p,I)$};
\def\ovalwidth{0.8}%Just used for the left one, adjust to make roughly match the others which are already wide
\def\ovalheight{0.4}%excess height, all will get the same height.
\coordinate(ovaltop) at ($(p.north)+(0,\ovalheight)$);
\coordinate(ovalbot) at ($(pb.south)-(0,\ovalheight)$);
\node[oval,inner sep=2pt,fit={(ovaltop)($(pb)+(\ovalwidth,0)$)($(pb)-(\ovalwidth,0)$)(ovalbot)},label=$\Omega$]{};
\node[oval,inner
sep=2pt,fit={(x0)(x0|-ovaltop)(x0|-ovalbot)($(x0)+(\ovalwidth,0)$)($(x0)-(\ovalwidth,0)$)},label={}]{};
\node[oval,inner
sep=2pt,fit={(x1)(x1|-ovaltop)(x1|-ovalbot)},label=$\mathscr{F}_\Pi(I)\subset\mathscr{F}_\Pi$]{};
\node[oval,inner
sep=2pt,fit={(y)(y|-ovaltop)(y|-ovalbot)},label=$\mathscr{G}_\Pi(I)\subset\mathscr{G}_\Sigma$]{};
\draw[-Latex] (p) -- node [above,loose]{$X_{\Pi I}(\p)$} (x0);
\draw[-Latex] (pb) -- node [below,loose]{$X_{\Pi I}(\bar\p)$} (x0b);
\draw[-Latex] (x0) -- (x1);
\draw[-Latex] (x0b) -- (x1);
\draw[-Latex] (x1) -- node [above,loose]{$Y_\Sigma(\x(\cdot;\p,I))$} (y);
\end{tikzpicture}
\end{document}


\documentclass[a4paper,11pt,twoside]{report}
\usepackage{mathrsfs}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,arrows.meta,shapes,fit}
\begin{document}
\begin{tikzpicture}[loose/.style={inner sep=.7em}, oval/.style={ellipse,draw}]
\newcommand{\p}{\mathbf{p}}
\newcommand{\x}{\mathbf{x}}
\node(p){$\p$};
\node[below=1 of p](pb){$\bar \p$};
\node[right=4 of p](x0){$\x$};
\node[right=4 of pb](x0b){$\bar\x$};
\node[right=4.5 of $(x0)!0.5!(x0b)$](y){$y(\cdot;\p,I)$};
\def\ovalwidth{0.8}%Just used for the left one, adjust to make roughly match the others which are already wide
\def\ovalheight{0.4}%excess height, all will get the same height.
\coordinate(ovaltop) at ($(p.north)+(0,\ovalheight)$);
\coordinate(ovalbot) at ($(pb.south)-(0,\ovalheight)$);
\node[oval,inner sep=2pt,fit={(ovaltop)($(pb)+(\ovalwidth,0)$)($(pb)-(\ovalwidth,0)$)(ovalbot)},label=$\Omega$]{};
\node[oval,inner
sep=2pt,fit={(x0)(x0|-ovaltop)(x0|-ovalbot)($(x0)+(\ovalwidth,0)$)($(x0)-(\ovalwidth,0)$)},label={}]{};
\node[oval,inner
sep=2pt,fit={(y)(y|-ovaltop)(y|-ovalbot)},label=$\mathscr{G}_\Pi(I)\subset\mathscr{G}_\Sigma$]{};
\draw[-Latex] (p) -- node [above,loose]{$X_{\Pi I}(\p)$} (x0);
\draw[-Latex] (pb) -- node [below,loose]{$X_{\Pi I}(\bar\p)$} (x0b);
\draw[-Latex] (x0) -- node [above,sloped]{$Y_\Sigma(\x(\cdot;\p,I))$} (y);
\draw[-Latex] (x0b) -- node [below,sloped]{$Y_\Sigma(\x(\cdot;\p,I))$} (y);
\end{tikzpicture}
\end{document}


• That's really great; I'm sorry, I just realized i miss-wrote some of the question, the xs are meant to be mapped onto the y not onto x(stuff) then y. Sep 17, 2018 at 20:44