4

I would like to adjust the positions of labels in the following diagram to be placed in the middle of the arrows. Thank you so much for the suggestions.

\documentclass{article}

\usepackage[justification=centering,font=small,labelfont=bf]{caption}
\usepackage{amsmath,amssymb}
\usepackage{xypic}
\xyoption{all}

\begin{document}

\title{Title}
\author{Author}
\date{Today}
\maketitle

\begin{figure}
\[
\xymatrixcolsep{1.5pc} \xymatrix{
\text{LTDS}  \ar@{=>}[d]^{\text{RRA}} \ar@{-->}[r] & \text{RRA} \ar@{=>}[d]^{\text{FxTS of ODEs}}_{\text{FxTS of TDSs}}
\\
\text{An LTI without delays} \ar@{=>}[d]_{\text{Equivalent}}^{\text{Transformations}}  
& {\begin{smallmatrix} \text{Equivalence of FxTS} \\ \text{between LTDS and LTI} \end{smallmatrix}} 
\ar@{-->}@/^4pc/[dddl] 
\\
\text{An LTI with a single input} \ar@{=>}[d]_{\text{FxTS of ODEs}}^{\text{Backstepping}} &
\\
\text{FxTC for LTI} \ar@{=>}[d]_{\text{Linear}}^{\text{Transformations}}
\\
\text{FxTC for LTDS}
}
\]
\caption{Schematic diagram of the proposed methodology}\label{fainait figure 1}
\end{figure}

\end{document}

enter image description here

2
  • 1
    please add the code as an MWE so that it compiles and shows the problem
    – js bibra
    Commented Feb 10, 2021 at 0:44
  • 1
    Now it can be compiled directly
    – Johannes
    Commented Feb 10, 2021 at 1:08

2 Answers 2

3

I'm not sure if this is what you mean by placing labels in the middle of the arrows—it looks strange to me. But here is a solution with tikz-cd.

enter image description here

\documentclass{article}

\usepackage[justification=centering,font=small,labelfont=bf]{caption}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}

\begin{document}

\begin{figure}
\[
\begin{tikzcd}[row sep=1cm]
\text{LTDS}\arrow[r, dashed]\arrow[d, Rightarrow, "\text{RRA}" description] & \text{RRA}\arrow[d, Rightarrow, "\text{FxTS of TDSs FxTS of ODEs}" description]\\
\text{An LTI with a single input}\arrow[d, Rightarrow, "\text{Equivalent Transformations}" description] & \begin{smallmatrix} \text{Equivalence of FxTS} \\ \text{between LTDS and LTI} \end{smallmatrix}\arrow[dddl, controls={+(0,-3) and +(3,0)}, dashed]\\
\text{An LTI with a single input}\arrow[d, Rightarrow, "\text{FxTS of ODEs Backstepping}" description]\\
\text{FxTC for LTI}\arrow[d, Rightarrow, "\text{Linear Transformations}" description]\\
\text{FxTC for LTDS}
\end{tikzcd}
\]
\caption{Schematic diagram of the proposed methodology}\label{fainait figure 1}
\end{figure}

\end{document}

The description key places labels in the middle of arrows.

If you must do this with xymatrix you can place the labels in the middle of the arrows using the | key instead of ^ or _. But I think this labeling looks worse with xymatrix than in tikz-cd. Here is the image (with the xy code following).

enter image description here

\xymatrixcolsep{1.5pc} \xymatrix{
\text{LTDS}  \ar@{=>}[d]|{\text{RRA}} \ar@{-->}[r] & \text{RRA} \ar@{=>}[d]|{\text{FxTS of ODEs FxTS of TDSs}}
\\
\text{An LTI without delays} \ar@{=>}[d]|{\text{Equivalent Transformations}}  
& {\begin{smallmatrix} \text{Equivalence of FxTS} \\ \text{between LTDS and LTI} \end{smallmatrix}} 
\ar@{-->}@/^4pc/[dddl] 
\\
\text{An LTI with a single input} \ar@{=>}[d]|{\text{FxTS of ODEs Backstepping}} &
\\
\text{FxTC for LTI} \ar@{=>}[d]|{\text{Linear Transformations}}
\\
\text{FxTC for LTDS}
}
3
  • 1
    Very very good.....with xy package :-))))))) an now you are to 9000 score.
    – Sebastiano
    Commented Mar 24, 2021 at 21:13
  • 1
    @Sebastiano :-))) Thanks! This made me laugh!
    – Sandy G
    Commented Mar 24, 2021 at 22:40
  • And I'm glad I made you laugh because I like to laugh a lot.
    – Sebastiano
    Commented Mar 24, 2021 at 22:43
0

With ^ the label is set to the left of the arrow, with _ to the right; with | it is placed in the middle.

I added some adjustments that maybe could be done also with Xy-pic methods, but…

The adjustments are for making the label slightly bigger and for hiding descenders in the main entries.

\documentclass{article}

\usepackage[justification=centering,font=small,labelfont=bf]{caption}
\usepackage{amsmath,amssymb}
\usepackage[all,cmtip]{xypic}

\newcommand{\ltext}[1]{\text{\fboxrule=0pt\fboxsep=2pt\fbox{#1}}}
\newcommand{\stext}[1]{\smash[b]{\text{#1}}}

\begin{document}

\begin{figure}[htp]
\[
\xymatrix@C=1.5pc{
\text{LTDS}  \ar@{=>}[d]|(0.45){\ltext{RRA}} \ar@{-->}[r] &
\text{RRA} \ar@{=>}[d]^(0.45){\ltext{FxTS of ODEs}}_(0.45){\ltext{FxTS of TDSs}}
\\
\stext{An LTI without delays} \ar@{=>}[d]|(0.45){\ltext{Equivalent Transformations}} &
{\begin{smallmatrix} \text{Equivalence of FxTS} \\ \text{between LTDS and LTI} \end{smallmatrix}} 
\ar@{-->}@/^4pc/[dddl] 
\\
\stext{An LTI with a single input} \ar@{=>}[d]|(0.45){\ltext{FxTS of ODEs Backstepping}} &
\\
\text{FxTC for LTI} \ar@{=>}[d]|(0.45){\ltext{Linear Transformations}}
\\
\text{FxTC for LTDS}
}
\]
\caption{Schematic diagram of the proposed methodology}\label{fainait figure 1}
\end{figure}

\end{document}

enter image description here

Please, note the cmtip option that I deem mandatory to get decent arrow tips.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .