2

i am trying to have two subfigures align, i.e. the bottom of the images be level, in addition to the subcaptions being level. Using normal subfigures, i know i can use [t]. The fact that i am putting axes labels on with tikzpicture, and have a differential as a label, which takes more vertical space, seems to change this. I have used code from Adding axes labels to LaTeX figures to add axes labels and "Evaluated at" bar for derivatives: \Bigr, \biggr, or \left...\right? for the differential evaluation.

Here is my code:

\documentclass{article}
\usepackage{amsmath,mleftright}
\usepackage{xparse}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{positioning}

\NewDocumentCommand{\evalat}{sO{\big}mm}{%
  \IfBooleanTF{#1}
   {\mleft. #3 \mright|_{#4}}
   {#3#2|_{#4}}%
}

\begin{document}
\begin{figure}[h!]
    \centering
        \begin{subfigure}[t]{0.47\textwidth}
            \begin{tikzpicture}[t]
                \node (img1)  {\includegraphics[scale=0.5]{image1.png}};
                \node[below=of img1, node distance=0cm, yshift=1cm] {Rise Time};
                \node[left=of img1, node distance=0cm, rotate=90, anchor=center,yshift=-0.7cm] {Velocity};
            \end{tikzpicture}
            \caption{test1}
            \label{fig:velrise}
        \end{subfigure}
        \begin{subfigure}[t]{0.47\textwidth}
            \begin{tikzpicture}[t]
                \node (img1)  {\includegraphics[scale=0.5]{image2.png}};
                \node[below=of img1, node distance=0cm, yshift=1cm] {$\evalat[\big]{\frac{dQ}{dt}}{\text{max}}$};
                \node[left=of img1, node distance=0cm, rotate=90, anchor=center,yshift=-0.7cm] {Velocity};
            \end{tikzpicture}
            \caption{test}
            \label{fig:dqdtrise}
        \end{subfigure}
    \caption{test3}
    \label{fig:matrices}
\end{figure}
\end{document}

Which produces: enter image description here

The input images are:

enter image description here enter image description here

0

3 Answers 3

2

like this?

enter image description here

for alignment of images as well of subcaptions is the simple solution both include to own row of table:

\documentclass{article}
\usepackage{amsmath,mleftright}
\usepackage{xparse}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usetikzlibrary{positioning}

\NewDocumentCommand{\evalat}{sO{\big}mm}{%
  \IfBooleanTF{#1}
   {\mleft. #3 \mright|_{#4}}
   {#3#2|_{#4}}%
}

\usepackage{tabularx}
\usepackage{subcaption}
\begin{document}
    \begin{figure}[htb]
\begin{tabularx}{\linewidth}{@{} *{2}{>{\raggedleft\arraybackslash}X} @{}}
\begin{tikzpicture}[baseline]
    \node[label=below:Rise Time,
         label=left:\rotatebox{90}{Velocity}]
    {\includegraphics[width=0.85\linewidth]{image1.png}};
\end{tikzpicture}   &   \begin{tikzpicture}[baseline]
                            \node[label=below:{$\evalat[\big]{\frac{dQ}{dt}}{\max}$},
                                 label=left:\rotatebox{90}{Velocity}]
                            {\includegraphics[width=0.85\linewidth]{image2.png}};
                        \end{tikzpicture}   \\
%
\begin{subfigure}{\linewidth}
\caption{test 1}
\label{fig:velrise}
\end{subfigure}     &   \begin{subfigure}{\linewidth}
                        \caption{test 2}
                        \label{fig:dqdtrise}
                        \end{subfigure}
\end{tabularx}
    \caption{test3}
    \label{fig:matrices}
\end{figure}
  • that your mwe can works i add the subcaption package.
  • images are in table align with option baseline (option t is unknown)
  • text beside of images i wrote as labels to node containing image
1

Something like this? You only need to adjust the text height and text depth of your nodes.

\documentclass{article}
\usepackage{amsmath,mleftright}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{xparse}
\NewDocumentCommand{\evalat}{sO{\big}mm}{%
  \IfBooleanTF{#1}
   {\mleft. #3 \mright|_{#4}}
   {#3#2|_{#4}}%
}


\begin{document}
\begin{figure}[h!]
    \centering
        \begin{subfigure}[t]{0.47\textwidth}
            \begin{tikzpicture}
                \node (img1)  {\includegraphics[width=0.8\linewidth]{image1.png}};
                \node[below=0em of img1,text height=2em,text depth=0.6em] {Rise Time};
                \node[left=3em of img1,rotate=90,anchor=center,yshift=-0.7cm] 
                {Velocity};
            \end{tikzpicture}
            \caption{test1}
            \label{fig:velrise}
        \end{subfigure}\quad%
        \begin{subfigure}[t]{0.47\textwidth}
            \begin{tikzpicture}
                \node (img1)  {\includegraphics[width=0.8\linewidth]{image2.png}};
                \node[below=0em of img1,text height=2em,text depth=0.6em] 
                {$\evalat[\big]{\frac{\mathrm{d}Q}{\mathrm{d}t}}{\text{max}}$};
                \node[left=3em of img1,  rotate=90, anchor=center,yshift=-0.7cm] {Velocity};
            \end{tikzpicture}
            \caption{test}
            \label{fig:dqdtrise}
        \end{subfigure}
    \caption{test3}
    \label{fig:matrices}
\end{figure}
\end{document}

enter image description here

1
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[h!]
  \begin{subfigure}{0.48\textwidth}\centering
    \raisebox{0.4\linewidth}{\rotatebox{90}{Velocity}}\,
    \includegraphics[width=0.9\linewidth]{/tmp/image1.png}

    Rise Time\vphantom{$\displaystyle\frac{Q}{d}$}
    \caption{test1}\label{fig:velrise}
  \end{subfigure}\hfill
  \begin{subfigure}{0.48\textwidth}\centering
    \raisebox{0.4\linewidth}{\rotatebox{90}{Velocity}}\,
    \includegraphics[width=0.9\linewidth]{/tmp/image2.png}

    $\displaystyle\frac{dQ}{dt}\Big|_{\text{max}}$
    \caption{test2}\label{fig:dqdtrise}
  \end{subfigure}
  \caption{test3}\label{fig:matrices}
\end{figure}
\end{document}

enter image description here

You must log in to answer this question.

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