[Xy-pic] XY figure

Ross Moore ross at ics.mq.edu.au
Tue Jan 26 19:44:36 CET 2010


Hello Tigran,

On 27/01/2010, at 1:35 AM, Tigran Sarukhanyan wrote:

> Hello everybody.
> I've tried to draw some graph with caption using xygraph as folowing.
>
> %--------------------------------------------------------------------- 
> ---------
> %\usepackage[all,dvips,graph]{xy}
> %\usepackage{subfig,graphicx}
>
> \begin{figure}[tbp]
> \centering
> \subfloat[Subcaption for First Part]{\label{subfig:continued:first}  
> %% label for first subfigure
> Some text here:
> 1.\quad
> \[ \mbox{ \xygraph{
> !{<0cm,0cm>;<1cm,0cm>:<0cm,1cm>::}
> !{(0,0) }*+{\bullet_{a}}
> !{(1,1) }*+{\bullet_{b}}
> !{(2,0) }*+{\bullet_{c}}
> !{(3,-1)}*+{\bullet_{d}}
> } } \]
> \caption{Example of Continued Figure (Empty graph)}
> \label{fig:continued:first} %% label for first figure
> \end{figure}
>
> \ref{subfig:continued:first}
> %--------------------------------------------------------------------- 
> ---------

This snippet is unbalanced.

There is no closing '}' for
    \subfloat[Subcaption for First Part]{

You should be getting messages in the .log  file indicating
a problem somewhere.
This *must* have some effect upon your output.
Just what, might depend upon which document-class
you are using, and whatever other packages are loaded.


When the \subfloat is closed between the  \] and  \caption ,
then the \ref works properly, in my testing.
However the use of \[ ... \]  produces a warning.
Why do you need displayed-math here?
The Xy-pic diagram works fine inline as well.

Alternatively, put in an extra \vbox :

\begin{figure}[tbp]
\centering
\subfloat[Subcaption for First Part]{\label{subfig:continued:first} % 
% label for first subfigure
\vbox{Some text here:\par   %% <---- \vbox  and \par
1.\quad
\[ \mbox{ \xygraph{   %% <----  the \mbox is redundant here !!
!{<0cm,0cm>;<1cm,0cm>:<0cm,1cm>::}
!{(0,0) }*+{\bullet_{a}}
!{(1,1) }*+{\bullet_{b}}
!{(2,0) }*+{\bullet_{c}}
!{(3,-1)}*+{\bullet_{d}}
} } \]
}}   %% <-----------  end of \vbox  and of  \subfloat
\caption{Example of Continued Figure (Empty graph)}
\label{fig:continued:first} %% label for first figure
\end{figure}


>
> The first problem is that the figure appears at the top of the  
> page, above the text "Some text here:".
> And the second problem is that the command \ref types 11.1 instead  
> of 1.1( how to refer to the figure by clicking on (1.1)).
>
> Best thanks.

Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the xy-pic mailing list