将两个图形并排放置

将两个图形并排放置

可能重复:
两个并排的身影
水平放置的子图

我想在文档中并排放置两个图形。我正在使用该subcaption包,我的代码如下

\documentclass[a4paper, 12pt, notitlepage]{report}
\usepackage{amsfonts} % if you want blackboard bold symbols e.g. for real numbers
\usepackage{graphicx} % if you want to include jpeg or pdf pictures
\usepackage{amsmath}
\usepackage{chngcntr}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}
\begin{figure}[h]
    \centering
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[width=0.4\textwidth]{tworoundgameeffortvaryingmujnegative}
        \caption{J=-1}
        \label{fig:tworoundvarymujnegative}
    \end{subfigure}
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[width=0.4\textwidth]{tworoundgameeffortvaryingmujpositive}
        \caption{$J=1$}
        \label{fig:tworoundvarymujpositive}
    \end{subfigure}
    \caption{Effort levels in round one and two with varying $\mu$. $\alpha=1$, $v=0.25$ and $w=0.25$}
    \label{fig:effortlevelsvarymu}
\end{figure}
\end{document}

由于某种原因,我的两张图片重叠在一起了。有人知道这是为什么吗?

相关内容