我想在顶部和左侧的子图上添加标签,我该怎么做?

我想在顶部和左侧的子图上添加标签,我该怎么做?

我想在顶部添加 A、B、C...,在左侧添加一、二、三

我想在顶部添加 A、B、C...,在左侧添加一、二、三,以下是我的代码:

\begin{figure*}[ht]
\centering
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5a1.png}
    \label{fig5a1}}
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5b1.png}
    \label{fig5b1}} 
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5c1.png}
    \label{fig5c1}}
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5d1.png}
    \label{fig5d1}} \\
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5a2.png}
    \label{fig5a2}}
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5b2.png}
    \label{fig5b2}} 
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5c2.png}
    \label{fig5c2}}
\subfloat[]{\includegraphics[width=0.22\columnwidth]{fig5d2.png}
    \label{fig5d2}}     
           \caption{picture}
\label{fig5}

\结束{图*}

答案1

在此处输入图片描述

\documentclass[twocolun]{article}

\usepackage{adjustbox}  % it load `graphicx` package too
\usepackage[skip=0.5ex, belowskip=1ex]{subcaption}

\usepackage{rotating, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
    \begin{figure*}[ht]
    \centering
\adjustboxset{width=\linewidth,valign=c, margin=0pt 3pt 0pt 3pt}
\begin{tabularx}{\linewidth}{@{} c CCCC @{}}
    & A & B & C & D     \\
\rotatebox{90}{\qquad   one}
    & \subfloat[\label{fig5a1}]{\adjincludegraphics{example-image-duck}}
        & \subfloat[\label{fig5b1}]{\adjincludegraphics{example-image-duck}}
            & \subfloat[\label{fig5c1}]{\adjincludegraphics{example-image-duck}}
                & \subfloat[\label{fig5d1}]{\adjincludegraphics{example-image-duck}} \\  
\rotatebox{90}{\qquad    two}
    & \subfloat[\label{fig5a2}]{\adjincludegraphics{example-image-duck}}
        & \subfloat[\label{fig5b2}]{\adjincludegraphics{example-image-duck}}
            & \subfloat[\label{fig5c2}]{\adjincludegraphics{example-image-duck}}
                & \subfloat[\label{fig5d2}]{\adjincludegraphics{example-image-duck}} \\
\end{tabularx}
\caption{picture}
\label{fig5}
    \end{figure*}
\end{document}

相关内容