1

How can I order the subfigures such that subfigure a,b,c is ordered one above the other in the left side of the figure and only subfigure d is in the right side of the figure?

\documentclass[11pt]{article}

\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{geometry}
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}


\begin{document}


\begin{figure}[h]
 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 1}\label{syntaxUW}
 \end{subfigure}    

 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 2}\label{UWBeispiel}
 \end{subfigure}

 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 3}\label{syntaxUW}
 \end{subfigure}

 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 4}\label{syntaxUW}
 \end{subfigure}            

\caption{fig 1}
\label{UWAbb}
\end{figure}

\end{document}
1

For this you have more possibilities. The simple one is to omit empty line between last and one before subfigure. In this case the subfigure d will be vertically aligned with subfigure c.

More elegant result you can achieve with use of tabular environment:

\documentclass[11pt]{article}

\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{geometry}
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}

\usepackage{array}% for m type of column

    \begin{document}
\begin{figure}[h]
    \begin{tabular}{m{0.5\hsize}m{0.5\hsize}}
 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 1}\label{syntaxUW}
 \end{subfigure}

 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 2}\label{UWBeispiel}
 \end{subfigure}

 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 3}\label{syntaxUW}
 \end{subfigure}
    &
 \begin{subfigure}{0.5\textwidth}
 \caption{subfig 4}\label{syntaxUW}
 \end{subfigure}
    \end{tabular}

\caption{fig 1}
\label{UWAbb}
\end{figure}
    \end{document}

enter image description here

For centering subfigures inside table columns you can redefine column types as

{>{\centering\arraybackslash}m{0.5\hsize} ...}

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.