如何为整个图形而不是子图添加 x&y 轴标签?

如何为整个图形而不是子图添加 x&y 轴标签?
\begin{figure}[htbp]
    \centering
    \begin{subfigure}[b]{0.24\textwidth}
    \includegraphics[width=1.85in]{1.pdf}\vfill
        \label{}
    \end{subfigure}
    \begin{subfigure}[b]{0.23\textwidth}        
        \includegraphics[width=1.85in]{2.pdf}\vfill
        \label{}
    \end{subfigure}
    \begin{subfigure}[b]{0.24\textwidth}        
        \includegraphics[width=1.85in]{3.pdf}\vfill
        \label{}
    \end{subfigure}
    \begin{subfigure}[b]{0.23\textwidth}
        \includegraphics[width=1.85in]{4.pdf}\vfill
        \label{}
    \end{subfigure}
    \caption{}
\end{figure}

我有一个带有 4 个子图的图。现在我想将 xlable=Time、ylable=intensity 添加到整个图而不是子图。

答案1

只是阐述一下 John Kormylos 的评论。以下是一些选项。

\documentclass{article}
\usepackage{subcaption}
\usepackage{pdflscape}
\usepackage{tikz} 
\usetikzlibrary{matrix}
\begin{document}
\section*{With subcaption}
\begin{figure}[htbp]
\centering
 \begin{tikzpicture}    
 \matrix (fig) [matrix of nodes]{
 \includegraphics[width=1.85in]{example-image.pdf}
 &
 \includegraphics[width=1.85in]{example-image-a.pdf}
 \\
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 \\
 \includegraphics[width=1.85in]{example-image-b.pdf}
 &
 \includegraphics[width=1.85in]{example-image-c.pdf}
 \\
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 \\
  };
 \path (fig-3-1.west)  -- (fig-1-1.west) node[midway,above,sloped]{intensity};
 \path (fig-4-1.south)  -- (fig-4-2.south) node[midway,below]{time};
 \end{tikzpicture}
    \caption{}
\end{figure}
\clearpage
\section*{Without subcaption}
\begin{figure}[htbp]
\centering
 \begin{tikzpicture}    
 \matrix (fig) [matrix of nodes]{
 \includegraphics[width=1.85in]{example-image.pdf}
 &
 \includegraphics[width=1.85in]{example-image-a.pdf}
 \\
 \includegraphics[width=1.85in]{example-image-b.pdf}
 &
 \includegraphics[width=1.85in]{example-image-c.pdf}
 \\
  };
 \path (fig-2-1.west)  -- (fig-1-1.west) node[midway,above,sloped]{intensity};
 \path (fig-2-1.south)  -- (fig-2-2.south) node[midway,below]{time};
 \end{tikzpicture}
    \caption{}
\end{figure}
\clearpage
\begin{landscape}
\section*{Landscape with caption}
\begin{figure}[htbp]
\centering
 \begin{tikzpicture}    
 \matrix (fig) [matrix of nodes]{
 \includegraphics[width=1.85in]{example-image.pdf}
 &
 \includegraphics[width=1.85in]{example-image-a.pdf}
 &
 \includegraphics[width=1.85in]{example-image-b.pdf}
 &
 \includegraphics[width=1.85in]{example-image-c.pdf}
 \\
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 \\
  };
 \path (fig-1-1.south west)  -- (fig-1-1.north west) node[midway,above,sloped]{intensity};
 \path (fig-1-1.north)  -- (fig-1-4.north) node[midway,above]{time};
 \end{tikzpicture}
 \caption{}
\end{figure}
\end{landscape}
\clearpage
\begin{landscape}
\section*{Landscape without caption}
\begin{figure}[htbp]
\centering
 \begin{tikzpicture}    
 \matrix (fig) [matrix of nodes]{
 \includegraphics[width=1.85in]{example-image.pdf}
 &
 \includegraphics[width=1.85in]{example-image-a.pdf}
 &
 \includegraphics[width=1.85in]{example-image-b.pdf}
 &
 \includegraphics[width=1.85in]{example-image-c.pdf}
 \\
  };
 \path (fig-1-1.south west)  -- (fig-1-1.north west) node[midway,above,sloped]{intensity};
 \path (fig-1-1.south)  -- (fig-1-4.south) node[midway,below]{time};
 \end{tikzpicture}
    \caption{}
\end{figure}
\end{landscape}
\end{document}

这给你例如

在此处输入图片描述

如果你想要轴,只需将\path图片中的命令替换为

 \draw[-latex] ([xshift=-2mm]fig-1-1.south west)  -- ([xshift=-2mm]fig-1-1.north west) node[midway,above,sloped]{intensity};
 \draw[-latex] ([yshift=2mm]fig-1-1.north)  -- ([yshift=2mm]fig-1-4.north) node[midway,above]{time};

要得到

在此处输入图片描述

其他选项也类似。

编辑:图中带有标题。

\documentclass{article}
\usepackage{subcaption}
\usepackage{tikz} 
\usetikzlibrary{matrix}
\begin{document}
\section*{With subcaptions in the pics}
\begin{figure}[htbp]
\centering
 \begin{tikzpicture}    
 \matrix (fig) [matrix of nodes]{
 \includegraphics[width=1.85in]{example-image.pdf}
 &
 \includegraphics[width=1.85in]{example-image-a.pdf}
 \\[-1cm] %<- adjust this to move the height of the subcaptions up or down
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 \\[0.2cm] %<- adjust this to make the distance to the next row smaller or larger
 \includegraphics[width=1.85in]{example-image-b.pdf}
 &
 \includegraphics[width=1.85in]{example-image-c.pdf}
 \\[-1cm] %<- adjust this to move the height of the subcaptions up or down
 |[text width=1.85in]| {\subcaption{}}
 &
 |[text width=1.85in]| {\subcaption{}}
 \\
  };
 \draw[-latex] ([xshift=-2mm,yshift=2mm]fig-1-1.south west)  -- ([xshift=-2mm,yshift=-2mm]fig-1-1.north west) node[midway,above,sloped]{intensity};
 \draw[-latex] ([xshift=-2mm,yshift=2mm]fig-3-1.south west)  -- ([xshift=-2mm,yshift=-2mm]fig-3-1.north west) node[midway,above,sloped]{intensity};
 \draw[-latex] ([yshift=-3mm,xshift=2mm]fig-4-1.south west)  -- ([yshift=-3mm,xshift=-2mm]fig-4-1.south east) node[midway,below]{time};
 \draw[-latex] ([yshift=-3mm,xshift=2mm]fig-4-2.south west)  -- ([yshift=-3mm,xshift=-2mm]fig-4-2.south east) node[midway,below]{time};
 \end{tikzpicture}
    \caption{}
\end{figure}
\end{document}

在此处输入图片描述

相关内容