子图并排放置不起作用

子图并排放置不起作用

我尝试在使用环境时并排设置两个图形,picture而不是includegraphics像这里大多数示例中那样。不幸的是,它们显示为堆叠的,我不知道我做错了什么。谁能帮忙?

\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}

答案1

您使用的封装宽度过大subfigure。将较小的乘数(例如0.48)放在\linewidth行前\begin{subfigure}[b]{0.5\linewidth}

相关内容