3

I am trying to make a Cayley graph of $D_{5}$ with the help of xymatrix package. However the arrows are not align to center of objects. Is there a way to do so?

$$
\xymatrixrowsep{0.01in}
\xymatrixcolsep{0.02in}
\xymatrix{
& & & & \reflectbox{\includegraphics[scale=0.1, angle=0, origin=c]{figures/poly5.jpg}} \ar[ddllll] \ar@{<->}[dd]   \\
\\
\reflectbox{\includegraphics[scale=0.1, angle=72, origin=c]{figures/poly5.jpg}} \ar[dddddrr] \ar@{<->}[drr]  &  & &         & \includegraphics[scale=0.1, angle=0, origin=c]{figures/poly5.jpg}   \ar[dll]   & & & & \reflectbox{\includegraphics[scale=0.1, angle=288, origin=c]{figures/poly5.jpg}}   \ar[lllluu]    \ar@{<->}[lld]      \\
& &    \includegraphics[scale=0.1, angle=72, origin=c]{figures/poly5.jpg}   \ar[ddr]   &&          &&
    \includegraphics[scale=0.1, angle=288, origin=c]{figures/poly5.jpg} \ar[ull]             \\ \\
 & & &  \includegraphics[scale=0.1, angle=144, origin=c]{figures/poly5.jpg} \ar[rr]                                    &&  \includegraphics[scale=0.1, angle=216, origin=c ]{figures/poly5.jpg} \ar[uur] \\ \\
 & & \reflectbox{\includegraphics[scale=0.1, angle=144, origin=c]{figures/poly5.jpg}} \ar[rrrr] \ar@{<->}[ruu]  & & & & \reflectbox{\includegraphics[scale=0.1, angle=216, origin=c ]{figures/poly5.jpg}} \ar[rruuuuu] \ar@{<->}[luu]
}
$$

cayley graph of $D_{5}$

3

Welcome to TeX.SE! You only need to wrap the graphics into \vcenter{\hbox{...}}. I do not have your jpg file, so when compiled on my machine the output looks a bit different. ;-)

\documentclass{article}
\usepackage[all]{xy}
\begin{document}
\[
\xymatrixrowsep{0.01in}
\xymatrixcolsep{0.02in}
\xymatrix{
& & & & \vcenter{\hbox{\reflectbox{\includegraphics[scale=0.1, angle=0,
origin=c]{figures/poly5.jpg}}}} \ar[ddllll] \ar@{<->}[dd]   \\
\\
\vcenter{\hbox{\reflectbox{\includegraphics[scale=0.1, angle=72,
origin=c]{figures/poly5.jpg}}}} \ar[dddddrr] \ar@{<->}[drr]  &  & &         &
\vcenter{\hbox{\includegraphics[scale=0.1, angle=0,
origin=c]{figures/poly5.jpg}}}   \ar[dll]   & & & &
\vcenter{\hbox{\reflectbox{\includegraphics[scale=0.1, angle=288,
origin=c]{figures/poly5.jpg}}}}   \ar[lllluu]    \ar@{<->}[lld]      \\
& &    \vcenter{\hbox{\includegraphics[scale=0.1, angle=72, origin=c]{figures/poly5.jpg}}}   \ar[ddr]   &&          &&
    \vcenter{\hbox{\includegraphics[scale=0.1, angle=288, origin=c]{figures/poly5.jpg}}} \ar[ull]             \\ \\
 & & & \vcenter{\hbox{\includegraphics[scale=0.1, angle=144,
origin=c]{figures/poly5.jpg}}} \ar[rr]                                    && 
\vcenter{\hbox{\includegraphics[scale=0.1, angle=216, origin=c ]{figures/poly5.jpg}}} \ar[uur] \\
\\
 & & \vcenter{\hbox{\reflectbox{\includegraphics[scale=0.1, angle=144,
origin=c]{figures/poly5.jpg}}}} \ar[rrrr] \ar@{<->}[ruu]  & & & &
\vcenter{\hbox{\reflectbox{\includegraphics[scale=0.1, angle=216, origin=c
]{figures/poly5.jpg}}}} \ar[rruuuuu] \ar@{<->}[luu]
}
\]
\end{document}

enter image description here

However, I would not use xy-matrix for that. With TikZ you can arrange the polygons in a polygon shape.

\documentclass[border=3.14mm,tikz]{standalone}
\usetikzlibrary{shapes.geometric}
\newsavebox\Poly
\sbox\Poly{\tikz{\node[draw,minimum size=3.14cm,regular polygon,regular polygon sides=5,fill=cyan!30]
(poly){};
\foreach \X [count=\Y] in {blue,red,yellow,black,green!60!black}
{\draw[fill=\X] (poly.corner \Y) circle(1mm);}}}
\begin{document}
\begin{tikzpicture}
\node[minimum size=10cm,regular polygon,regular polygon sides=5]
(outer poly){};
\node[minimum size=6cm,regular polygon,regular polygon sides=5]
(inner poly){};
\foreach \X in {1,...,5}
{\node[scale=0.3,rotate={72*(1-\X)},inner sep=0pt] (outer-\X) at (outer poly.corner \X) {\usebox\Poly};
\node[scale=0.3,rotate={72*(1-\X)},xscale=-1,inner sep=0pt] (inner-\X) at (inner poly.corner \X) {\usebox\Poly};
}
\foreach \X [evaluate=\X as \Y using {int(1+mod(\X+3,5))}]in {1,...,5}
{\draw[-latex] (outer-\Y) -- (outer-\X);
\draw[-latex] (inner-\X) -- (inner-\Y);
\draw[latex-latex] (inner-\X) -- (outer-\X); }
\end{tikzpicture}
\end{document}

enter image description here

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.