# Subfigures side by side not working

I am trying to set two figures side by side while using the picture environment instead of includegraphics as shown in most examples here. Unfortunately they are displayed stacked and I do not know what I am doing wrong. Who can help?

\documentclass[10pt,a4paper,landscape,twocolumn]{article}
\usepackage{geometry}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}

\begin{document}

\setlength{\unitlength}{2.0cm}
\begin{figure}
\centering

\begin{subfigure}[b]{0.5\linewidth}
\centering
\begin{picture}(1,2)
\put(0,0){\circle*{0.1}}
\put(0,1){\circle*{0.1}}
\put(1,0){\circle*{0.1}}
\put(1,1){\circle*{0.1}}
\put(0.5,1.75){\circle*{0.1}}
\put(0.5,0.5){\circle*{0.1}}
\thicklines
\put(0,0){\vector(0,1){1}}
\put(0,1){\vector(2,3){0.5}}
\put(0.5,1.75){\vector(2,-3){0.5}}
\put(1,1){\vector(0,-1){1}}
\put(1,0){\vector(-1,0){1}}
\put(0,0){\vector(1,1){0.5}}
\put(0.5,0.5){\vector(1,1){0.5}}
\put(1,1){\vector(-1,0){1}}
\put(0,1){\vector(1,-1){0.5}}
\put(0.5,0.5){\vector(1,-1){0.5}}
\end{picture}
\caption{Euler-Path}
\end{subfigure}
\begin{subfigure}[b]{0.5\linewidth}
\centering
\begin{picture}(1,2)
\put(0,0){\circle*{0.1}}
\put(0,1){\circle*{0.1}}
\put(1,0){\circle*{0.1}}
\put(1,1){\circle*{0.1}}
\put(0.5,1.75){\circle*{0.1}}
\put(0.5,0.5){\circle*{0.1}}
\thicklines
\put(0,0){\vector(0,1){1}}
\put(0,1){\vector(2,3){0.5}}
\put(0.5,1.75){\vector(2,-3){0.5}}
\put(1,1){\vector(0,-1){1}}
\put(1,0){\vector(-1,1){0.5}}
\put(0.5,0.5){\vector(-1,-1){0.5}}
\end{picture}
\caption{Hammilton-Cycle}
\end{subfigure}

\caption{House of Santa Clause}
\end{figure}

\end{document}

-
Just put % after the first \end{subfigure} –  egreg Dec 16 '12 at 10:35
Thanks, that also worked. –  hielsnoppe Dec 16 '12 at 12:06
The end of line counts as a space when LaTeX is typesetting a paragraph; see this answer for more information. –  egreg Dec 16 '12 at 12:09
add comment

## 1 Answer

You are using to much width for subfigure package. Put the smaller multiplier (for example 0.48) before the \linewidth in \begin{subfigure}[b]{0.5\linewidth} line.

-
Outch, how easy was that!? Thank you. –  hielsnoppe Dec 16 '12 at 10:28
@hielsnoppe: No problem! –  m0nhawk Dec 16 '12 at 10:40
add comment