[Xy-pic] inexact end points of arrows in \xymatrix (data flow diagram)
Ross Moore
ross@ics.mq.edu.au
Fri, 5 Apr 2002 20:36:29 +1000 (EST)
> (I posted the following in comp.text.tex but received no solution.
> So I am now sending this to the specialists :-) - Hello.)
>
Yes; we're listening.
> ---
>
> I like the Xy-pic package (version 3.7 <1999/02/16>) very much,
> especially the \xymatrix command.
> But now I am faced with the problem that arrows are inexact, i.e.
> they don't always start or end where they should (at the boundary of
> an object).
> Here is a minimal example, a data flow diagram in Xy-pic:
>
> \documentclass{article}
>
> \usepackage[arrow,frame,matrix]{xy}
>
> \newcommand{\datacoll}[1]{*[F_)][F^)]{\parbox{8 em}{\begin{center}#1\end{center}}}}
> \newcommand{\funcoll}[1]{*[Fo]{\parbox{8 em}{\begin{center}#1\end{center}}}}
^^ ^^^^^^^^^^^^^
This is a bad choice of frame for that type of object.
Your PDF file shows a circular frame; presumably because you have not specified
a back-end driver that supports drawing ellipses; as a result, you just get
a circle constructed from font-pieces.
The arrows do not meet the (approximate) circle, because they are calculated
so as to meet the boundary of the (correct) ellipse.
ou just have to specify how to draw that ellipse (or choose a different frame).
There are several remedies:
1. specify a PostScript back-end driver;
e.g. dvips
\usepackage[ps,dvips,all,frame,matrix]{xy}
This will draw the ellipse using PostScript \special commands.
To get a PDF file, use ps2pdf or Distiller .
OR
2. use the \UseCurveFrames command, from xyframe.tex .
This will draw the ellipses using xycurve.tex
i.e. as a multitude of closely spaced dots.
This works with any driver (including xypdf.tex for pdftex),
but will almost certainly require that you use hugelatex
since it can be a real memory-hog.
OR
3. change the frame-style to "Rounded-rectangles": [F-:<dimen>]
see figure 9 of the Xy-pic Reference Manual, and section 9.4
for examples and notes on how to use this frame style.
This is probably the most suitable solution for your kind
of diagram.
Hope this helps,
Ross Moore
> \newcommand{\extent}[1]{*[F-]{\parbox{8 em}{\begin{center}#1\end{center}}}}
> \newcommand{\flow}[1]{\ar[#1]}
> \newcommand{\bflow}[1]{\ar@{<->}[#1]}
>
> \begin{document}
> \mbox{\xymatrix{
> &
> \datacoll{corpus}
> \flow{r}
> \flow{d}
> &
> \extent{annotators}
> \flow{r}
> &
> \datacoll{annotations (keys)}
> \flow{d}
> \\
> &
> \funcoll{train and test set sampler (1)}
> \flow{d}
> \flow{dr}
> &
> &
> \funcoll{train and test annotation sampler (1)}
> \flow{d}
> \flow{dr}
> \\
> &
> \datacoll{train set}
> &
> \datacoll{test set}
> &
> \datacoll{train annotations (1)}
> &
> \datacoll{test annotations}
> \\
> }}
>
> \end{document}
>
> The output from pdflatex can be seen at:
> http://pi7.fernuni-hagen.de/hartrumpf/bugxy.pdf (bugxy.tex)
> The problem also exists in the DVI file.
>
> All hints welcome.
>
>
> ---
>
> (Adding dvips option for .ps file does not help,
> see http://pi7.fernuni-hagen.de/hartrumpf/bugxy.ps)
> _______________________________________________
> Xy-pic mailing list
> http://tug.org/mailman/listinfo/xy-pic