更改子图中标题的位置

更改子图中标题的位置

你好,我正在尝试更改每个子情节中指定角色的定位。目前我有三个相邻的子情节:

\begin{figure}[h!]
 \centering
\begin{subfigure}[b]{0.31\textwidth}
     \centering
     \includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm},clip,width=\textwidth]{My_first_subplot}
     \caption{}
     \label{My first subplot label}
 \end{subfigure}
 \hfill
 \begin{subfigure}[b]{0.31\textwidth}
     \centering
     \includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm},clip,width=\textwidth]{my second subplot}
     \caption{}
     \label{my second subplot label}
 \end{subfigure}
 \hfill
 \begin{subfigure}[b]{0.31\textwidth}
     \centering
     \includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm},clip,width=\textwidth]{my third subplot}
     \caption{}
     \label{My third subplot label}
 \end{subfigure}
    \caption{Caption of all tree plots}
    \label{label of all three plots}
\end{figure}

不幸的是,我的文档中已经有很多这样的图,所以我希望可以对我的代码进行轻微的调整。但如果我必须重新制作,那就这样吧:)

可以看到,此代码生成了三个子图,其下方分别为 (A)、(B)、(C)。我希望每个子图的左上角都有字符​​,但不带括号。

像这样

我希望我的问题很清楚并且有人可以帮助我,因为我对乳胶还很陌生。

谢谢你!

答案1

\documentclass{article}
\usepackage[labelformat=simple, singlelinecheck=off]{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.31\textwidth}
\centering
\caption{}
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-a}
\label{My first subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\caption{}
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-b}
\label{my second subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\caption{}
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-c}
\label{My third subplot label}
\end{subfigure}
\caption{Caption of all tree plots}
\label{label of all three plots}
\end{figure}
\end{document}

左上角带有副标题的三张图片

编辑:图片内有说明stackengine

\documentclass{article}
\usepackage{stackengine}
\usepackage[labelformat=simple, singlelinecheck=off]{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.31\textwidth}
\centering
\phantomcaption
\stackinset{l}{2pt}{t}{2pt}{\captiontext*}
{\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-a}}
\label{My first subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\phantomcaption
\stackinset{l}{2pt}{t}{2pt}{\captiontext*}
{\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-b}}
\label{my second subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\phantomcaption
\stackinset{l}{2pt}{t}{2pt}{\captiontext*}
{\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-c}}
\label{My third subplot label}
\end{subfigure}
\caption{Caption of all tree plots}
\label{label of all three plots}
\end{figure}
\end{document}

三张图片,左上角带有标题

相关内容