2

I'm trying to make a nice state diagram with some arrows

I cannot find a way to make the arrows pointing to the same state: in my case, I would like a self-refering arrow to altcache

I'm not fixed about the fancybox, but it would nicely fit in the rest of the thesis.

Thanks a lot for your help

Here is an example of code and the result:

enter image description here

I just need a circle dashed arrow at altcache...


\documentclass{article}
\usepackage{amstext}
\usepackage{fancybox}
\usepackage[all]{xy}

\newcommand{\boxsize}{1.4in}
\newcommand{\state}[1]%
  {\doublebox{\text{\begin{minipage}{\boxsize}\centering #1\end{minipage}}}}
\newcommand{\switch}[1]%
  {\ovalbox{\text{\begin{minipage}{\boxsize}\centering #1\end{minipage}}}}

\begin{document}

\xymatrix{
\switch{lscache} \ar@{.>}[d] \ar@{.>}[rdd] &  &\\
\switch{tccache} \ar@{.>}[rd] & & \\
\switch{altcache} & \ar@{.>}[l] \switch{cache}  & \\
}

\end{document}
3

You can specify the exit/entrance directions by adding @(out,in) to the arrow command, where in and out are two direction specifiers (ul, dl, ur, dr, etc.). In order to create a circular arrow above the box altcache, add @(ul,ur):

\xymatrix{
  \switch{lscache}  \ar@{.>}[d] \ar@{.>}[rdd] & &\\
  \switch{tccache}  \ar@{.>}[rd]     & & \\
  \switch{altcache} \ar@{.>}@(ul,ur) & \ar@{.>}[l] \switch{cache}  & 
}

enter image description here

0

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.