图形周围的箭头-无 TikZ

图形周围的箭头-无 TikZ

我目前有一个如下的数字网格:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[verbose,margin=0.1in]{geometry}
\graphicspath{{./images/}}
\newcommand{\xdownarrow}[1]{%
  {\left\downarrow\vbox to #1{}\right.\kern-\nulldelimiterspace}
}

\begin{document}
    \begin{figure}
        \hspace{0.6cm}$\pmb{\xrightarrow{\hspace{2.3cm}label1\hspace{2.9cm}label2\hspace{2.4cm}label3\hspace{2.95cm}label4\hspace{2.2cm}}}$
        \\[-0.4cm]
        \begin{minipage}[t][14.2cm][b]{0.01\linewidth}
            \rotatebox{90}{$\pmb{vlabel1}$}
            \vfill
            \rotatebox{90}{$\pmb{vlabel2}$}
        \end{minipage}
        \begin{minipage}[t][][b]{0.01\linewidth}
            $\pmb{\xdownarrow{7.4cm}}$
        \end{minipage}
        \begin{minipage}[t][][b]{0.97\linewidth}
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\linewidth]{{image1}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image2}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image3}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image4}.pdf}\\
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\linewidth]{{image5}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image6}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image6}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image8}.pdf}\\
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\linewidth]{{image9}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image10}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image11}.pdf}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\linewidth]{{image12}.pdf}\\
            \includegraphics[trim=0.0cm 0.0cm 0 0,clip,width=0.249\linewidth]{{image13}.pdf}
            \includegraphics[trim=1.1cm 0.0cm 0 0,clip,width=0.230\linewidth]{{image14}.pdf}
            \includegraphics[trim=1.1cm 0.0cm 0 0,clip,width=0.230\linewidth]{{image15}.pdf}
            \includegraphics[trim=1.1cm 0.0cm 0 0,clip,width=0.230\linewidth]{{image16}.pdf}
        \end{minipage}
    \end{figure}
\end{document}

这将生成一个 4x4 的图像网格,上面有一个右箭头,带有 4 个标签空格,左边有一个向下箭头,带有两个间隔的标签。这些硬编码的长度不切实际。由于这不会是我最后一次需要制作这样的图形,我怎样才能让上面的方法正常工作?我希望通过缩放 3d 迷你页面自动发生以下情况,其中包含图形:

  1. 上方的箭头横跨网格的整个水平范围
  2. 箭头上方有 4 个标签,间距相等,使得它们在每个图上水平居中
  3. 左侧有一个箭头,横跨整个网格的垂直范围
  4. 两个标签旋转至箭头左侧,上方标签结束于箭头起点,下方标签开始于箭头终点

主要问题是长度不知为何没有设置,所以我无法正确使用\vfill\hfill而且如果不指定第一个高度,迷你页面也无法对齐。如果可以在其余图形元素之前设置图形迷你页面,那么也许所有长度(文本高度、线宽等)都会被设置。

我并不想寻求tikz解决方案,但愿意放弃小页面或其他任何东西。

答案1

答案分为三部分。

第 1 部分:非 TikZ 解决方案

这是不依赖 TikZ 的解决方案的开始。肯定还有改进的空间。但这肯定比我之前发布的非 TikZ 方法要好。

\documentclass{article}
\usepackage[draft]{graphicx}
\usepackage{amsmath}
\usepackage[margin=0.1in]{geometry}
\graphicspath{{../images/}}

\newcommand{\myxdownarrow}[2]{%%                        
  %% use raisebox here to shift the vertical arrow down 
  %% so that it appears to only span the portion of the 
  %% table contains the images                          
  \raisebox{-3ex}[0.5\dimexpr#1]{$\pmb{\left\downarrow\rule[-0.5\dimexpr#1-3ex]{0pt}{\dimexpr#1-3ex}\right.}$}}%%
\newcommand{\myxrightarrow}[1]{%%
  %% use raisebox here to shift the horizontal arrow down
  %% so that it appears below the labels across the top of
  %% the table
  \raisebox{-4ex}[0pt][0pt]{\rotatebox{90}{$\pmb{\left\downarrow\rule[-0.5\dimexpr#1]{0pt}{#1}\right.}$}}}%%

\newsavebox\aepic
\newlength\aelength

\newsavebox\aepicA
\newsavebox\aepicB
\newsavebox\aepicC
\newsavebox\aepicD

\makeatletter

\newtoks\ae@tok@master

%% ------------------------------------------------------------     
%% two arguments:                                                   
%% ARG #1=label for the row being created                           
%% ARG #2=contents of the row                                       
%%        foreach each cell three pieces need to be passed          
%%                                                                  
%%        * optional arguments for \includegraphics                 
%%        * file handle for image to be used                        
%%        * the name of a save box for this particular image        
%%                                                                  
%%        which will be used by an internal command \ae@process@item
%% ------------------------------------------------------------     
\newcommand\aejustrow[2]{%%
  \ae@tok@master={}%%
  \def\ae@wd{0pt}%%
  \def\ae@ht{0pt}%%
  \def\ae@row@label{#1}%%
  \ae@row@content#2;\relax;\relax\end@row@content
  \expandafter\typeout\expandafter{\the\ae@tok@master}%%
  \rotatebox{90}{\makebox[\ae@ht][c]{#1}} \the\ae@tok@master 
}

%% 
\def\ae@row@content#1;#2\end@row@content{%%
  \ifx\relax#1
    \def\ae@continue{}%%
  \else
    \ae@process@item#1;%%
    \def\ae@continue{\ae@row@content#2\end@row@content}%%
  \fi
  \ae@continue
  }

%% ARG #1 = options to be passed to \includegraphics
%% ARG #2 = image file handle
%% ARG #3 = savebox name
\def\ae@process@item#1#2#3;{%%
  %% see https://tex.stackexchange.com/a/49136/22413
  %% for what's going on with `0\null\global....`
  \begin{lrbox}{0\null\global\setbox#3}%%
    \includegraphics#1{#2}%%
  \end{lrbox}%%
  %% determine the maximal height of the images being used.
  \ifdim\ae@ht<\ht#3%%
    \xdef\ae@ht{\the\ht#3}%%
  \fi
  \ae@tok@master=\expandafter{\the\ae@tok@master & \noexpand\usebox{#3}}%%
  }

\makeatother

\begin{document}

        \setlength\aelength{\dimexpr0.97\linewidth-3ex}%%
        \begin{lrbox}\aepic
          \setlength\tabcolsep{0.5pt}%%
          \begin{tabular}[t]{c@{\hspace{1em}}cccc}
             \rule[-4ex]{0pt}{1pt}%% a vertical strut to get horizontal line under labels
              & label1 & label2 & label3 & label4 \\
              \aejustrow{vlable 1}{%%
                {[trim=0.0cm 0.0cm 0 0,clip,width=0.249\aelength]}{image1.pdf}{\aepicA};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image2.pdf}{\aepicB};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image3.pdf}{\aepicC};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image4.pdf}{\aepicD}} \\
              \aejustrow{vlable 2}{%%
                {[trim=0.0cm 0.0cm 0 0,clip,width=0.249\aelength]}{image5.pdf}{\aepicA};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image6.pdf}{\aepicB};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image7.pdf}{\aepicC};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image8.pdf}{\aepicD}} \\
              \aejustrow{vlable 3}{%%
                {[trim=0.0cm 0.0cm 0 0,clip,width=0.249\aelength]}{image9.pdf}{\aepicA};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image10.pdf}{\aepicB};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image11.pdf}{\aepicC};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image12.pdf}{\aepicD}} \\
              \aejustrow{vlable 4}{%%
                {[trim=0.0cm 0.0cm 0 0,clip,width=0.249\aelength]}{image13.pdf}{\aepicA};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image14.pdf}{\aepicB};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image15.pdf}{\aepicC};
                {[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]}{image16.pdf}{\aepicD}}
          \end{tabular}
        \end{lrbox}%%

\begin{figure}
  \hspace{2em}\myxrightarrow{\dimexpr\wd\aepic -2.25em}\\[-0.4cm]%%
  \makebox[0pt][l]{\raisebox{-\height}[0pt][\dimexpr\height+\depth]
      {\hspace*{1em}\myxdownarrow{\dimexpr\ht\aepic+\dp\aepic-1ex\relax}}}%%
  \raisebox{-\height}[0pt][\dimexpr\height+\depth]{\usebox\aepic}%%
\end{figure}

\end{document}

在此处输入图片描述

这种解决方案对我来说仍然不完全令人满意。它似乎严格地局限于一种特定的图像呈现方式,缺乏我喜欢的那种灵活性。让事情协调起来很麻烦。尽管如此,我希望这可以帮助您获得所需的结果。

所有这些工作真的感觉像是重新发明轮子:可能需要在 LaTeX 的内部进行大量的工作。

还有许多其他软件包可用于帮助进行此类标记。JohnKormylo 向您展示了如何在环境中执行此操作picture。也可以使用 执行类似操作pstricks。不过我想向您推销TikZ。所以这就是我在这篇文章的其余部分将讨论的内容。

第 2 部分:TikZ 的隐患

所以,我知道你说你不想使用 TikZ。但是,除非你有来自出版商或顾问的限制……,我觉得你可以使用 TikZ 非常轻松、干净地完成这项工作。所以,这是我的解决方案的 TikZ 版本。我在该解决方案的代码之后解释了我所做的事情。

在此处输入图片描述

这是生成此代码的代码

\documentclass{article}
\usepackage[draft]{graphicx}
\usepackage{amsmath}
\usepackage[showframe,margin=0.1in]{geometry}
\graphicspath{{./images/}}

\usepackage{tikz}
\usetikzlibrary{calc,fit,arrows.meta}
\newlength\aelength
\newbox\aepic

\newcommand\aegraphic[3][]  {%% 
  \tikz[remember picture,overlay] \node (#2/BL) {};%%
  \tikz \node[anchor=south west,inner sep=0pt] (#2) at (#2/BL) {\includegraphics[#1]{#3}};%%
  }

\begin{document}

\setlength\aelength{\dimexpr\linewidth-3em}%%
\begin{figure}
  \setlength\tabcolsep{1.5pt}%%
  \hspace*{3em}%%
  \begin{tabular}[t]{cccc}
      \aegraphic[trim=0.0cm 1.1cm 0 0,clip,width=0.249\aelength]{A1}{{image1}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{A2}{{image2}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{A3}{{image3}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{A4}{{image4}.pdf}\\
      %% ------------------------------------------------------------------------------------
      \aegraphic[trim=0.0cm 1.1cm 0 0,clip,width=0.249\aelength]{B1}{{image5}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{B2}{{image6}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{B3}{{image7}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{B4}{{image8}.pdf}\\
      %% ------------------------------------------------------------------------------------
      \aegraphic[trim=0.0cm 1.1cm 0 0,clip,width=0.249\aelength]{C1}{{image9}.pdf}  &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{C2}{{image10}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{C3}{{image11}.pdf} &
      \aegraphic[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{C4}{{image12}.pdf}\\
      %% ------------------------------------------------------------------------------------
      \aegraphic[trim=0.0cm 0.0cm 0 0,clip,width=0.249\aelength]{D1}{{image13}.pdf} &
      \aegraphic[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]{D2}{{image14}.pdf} &
      \aegraphic[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]{D3}{{image15}.pdf} &
      \aegraphic[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]{D4}{{image16}.pdf}
  \end{tabular}%%
  \begin{tikzpicture}[remember picture,overlay]
      \node[fit=(A1) (A2) (A3) (A4)
                (B1) (B2) (B3) (B4)
                (C1) (C2) (C3) (C4)
                (D1) (D2) (D3) (D4),
                inner sep=0pt,
                ] (PIC) {};

      \draw[line width=1pt,arrows={-Stealth[length=4mm]}] ([xshift=-1em]PIC.north west) -- ([xshift=-1em]PIC.south west);
      \draw[line width=1pt,arrows={-Stealth[length=4mm]}] ([yshift=1em]PIC.north west) -- ([yshift=1em]PIC.north east);

      \node[anchor=south] (COL1/label) at ([yshift=1em]A1|-PIC.north) {Column Label  1};
      \node[anchor=south] (COL2/label) at ([yshift=1em]A2|-PIC.north) {Column Label  2};
      \node[anchor=south] (COL3/label) at ([yshift=1em]A3|-PIC.north) {Column Label  3};
      \node[anchor=south] (COL4/label) at ([yshift=1em]A4|-PIC.north) {Column Label  4};

      \node[anchor=center,rotate=90] (ROW1/label) at ([xshift=-1.5em]A1-|PIC.west) {ROW 1 label};
      \node[anchor=center,rotate=90] (ROW2/label) at ([xshift=-1.5em]B1-|PIC.west) {ROW 2 label};
      \node[anchor=center,rotate=90] (ROW3/label) at ([xshift=-1.5em]C1-|PIC.west) {ROW 3 label};
      \node[anchor=center,rotate=90] (ROW4/label) at ([xshift=-1.5em]D1-|PIC.west) {ROW 4 label};

      \node[blue,anchor=south] at (A1.north) {Description of first pic};

  \end{tikzpicture}
\end{figure}

\end{document}

TikZ 解决方案说明

我在这里试图尽量减少你使用 TikZ 时的麻烦。这里的关键有两个:使用覆盖配件

我仍然使用tabular环境来布局图片。这可以在 Tikz 图片中完成。但是,由于我不知道您所有的潜在限制,我放弃了以这种方式制作整个图形。特别是,我不知道您想如何处理高度或宽度不相等的对齐图片。

表格环境的每个单元tabular都有三件事要做:

  • 蒂克兹标记创建。这是为了帮助我们稍后记住图片的位置。
  • 使用 TikZ 标记,将创建另一个 TikZ 节点,图像将放置在该节点中。这将为我们提供有关图片边缘位置的信息,而 TikZ 标记无法提供这些信息。
  • 我定义了一个命令\aegraphic来简化一些事情。而且,它使代码更具可读性。此命令有三个参数。第一个是可选的,包含您要传递给的键值\includegraphics,第二个参数是您将在其中放置图形的节点的名称,第三个参数是图像文件的名称。

创建图像表后,我会创建一个PIC节点来容纳所使用的每个图形的所有节点。现在我可以轻松确定图像顶部和左侧的箭头应该放在哪里。我还可以轻松地将标签放置在行旁边(正确旋转)和每列上方。

我使用 TikZ 的要点如下:

  • 锚定:这有助于我们将图片的各个元素彼此相对放置,而无需知道它们的确切位置。
  • 旋转:旋转发生在节点的。
  • 语法(<node_A>-|<node_B>):这将获取y来自节点的坐标Ax节点的坐标B。同样,(<node_A>|-<node_B>)只需将其翻转即可。
  • 语法([<options>]node-name):这允许进行微调,例如相对于表定义的节点移动图像边缘的箭头。
  • remember picture,overlay语法:这是告诉 TikZ 记住这张图片的放置位置,本质上允许您将 TikZ 图片放置在页面上的任何位置,而不管其他内容。

第 3 部分:完整的 TikZ 解决方案

这个解决方案的优点在于使用 TikZ 矩阵构造与使用tabular环境非常相似。所以,这意味着没有太多东西需要学习。此外,这overlays可能会很烦人,因为它们可能会侵入文档的其他部分,这意味着您必须进入并手动修复问题。在这个完全的 TikZ 解决方案中,不需要进行这样的手动调整。而且,除了使用\matrixTikZ 包中提供的命令外,其他一切都没有改变。我可能不需要在这里使用拟合库,但我必须去上班,所以我将留到以后再考虑。

我对tabular环境方法的一个问题是,虽然设置列之间的距离相当简单,但没有简单的方法可以以相同的程度控制行之间的距离(至少我不知道有任何方法,如果我错了,请在评论中告诉我)。但是,即使有这样的控制,在 TikZ 中,我也可以很容易地控制图像周围间距的呈现,只需一个钥匙 inner sep=1pt或任何其他希望的值。

在此处输入图片描述

该解决方案的代码:

\documentclass{article}
\usepackage[draft]{graphicx}
\usepackage[showframe,margin=0.1in]{geometry}
\graphicspath{{./images/}}

\usepackage{tikz}
\usetikzlibrary{calc,fit,arrows.meta}
\newlength\aelength

\begin{document}

\begin{figure}
  \setlength\aelength{\dimexpr\linewidth-3em}%%
  \centering
  \begin{tikzpicture}

  \matrix[nodes={anchor=south west,inner sep=1pt}]{ 
    \node (A1) {\includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\aelength]{{image1}.pdf}};  & 
    \node (A2) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image2}.pdf}};  & 
    \node (A3) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image3}.pdf}};  & 
    \node (A4) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image4}.pdf}}; \\
    \node (B1) {\includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\aelength]{{image5}.pdf}}; & 
    \node (B2) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image6}.pdf}}; &
    \node (B3) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image7}.pdf}}; &
    \node (B4) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image8}.pdf}}; \\
    \node (C1) {\includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\aelength]{{image9}.pdf} }; & 
    \node (C2) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image10}.pdf}}; &
    \node (C3) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image11}.pdf}}; &
    \node (C4) {\includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\aelength]{{image12}.pdf}}; \\
    \node (D1) {\includegraphics[trim=0.0cm 0.0cm 0 0,clip,width=0.249\aelength]{{image13}.pdf}}; & 
    \node (D2) {\includegraphics[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]{{image14}.pdf}}; &
    \node (D3) {\includegraphics[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]{{image15}.pdf}}; &
    \node (D4) {\includegraphics[trim=1.1cm 0.0cm 0 0,clip,width=0.230\aelength]{{image16}.pdf}}; \\
  };

  \node[fit=(A1) (A2) (A3) (A4)
            (B1) (B2) (B3) (B4)
            (C1) (C2) (C3) (C4)
            (D1) (D2) (D3) (D4),
            inner sep=0pt,
            ] (PIC) {};

  \draw[line width=1pt,arrows={-Stealth[length=4mm]}] ([xshift=-1em]PIC.north west) -- ([xshift=-1em]PIC.south west);
  \draw[line width=1pt,arrows={-Stealth[length=4mm]}] ([yshift=1em]PIC.north west) -- ([yshift=1em]PIC.north east);

  \node[anchor=south] (COL1/label) at ([yshift=1em]A1|-PIC.north) {Column Label  1};
  \node[anchor=south] (COL2/label) at ([yshift=1em]A2|-PIC.north) {Column Label  2};
  \node[anchor=south] (COL3/label) at ([yshift=1em]A3|-PIC.north) {Column Label  3};
  \node[anchor=south] (COL4/label) at ([yshift=1em]A4|-PIC.north) {Column Label  4};

  \node[anchor=center,rotate=90] (ROW1/label) at ([xshift=-1.5em]A1-|PIC.west) {ROW 1 label};
  \node[anchor=center,rotate=90] (ROW2/label) at ([xshift=-1.5em]B1-|PIC.west) {ROW 2 label};
  \node[anchor=center,rotate=90] (ROW3/label) at ([xshift=-1.5em]C1-|PIC.west) {ROW 3 label};
  \node[anchor=center,rotate=90] (ROW4/label) at ([xshift=-1.5em]D1-|PIC.west) {ROW 4 label};

  \node[blue,anchor=south,inner sep=0pt] at (C1.north) {Description of this pic below};

\end{tikzpicture}
\end{figure}

\end{document}

答案2

此解决方案使用图片环境。它还使用 \vbox 和 \hbox 将图像打包成最小尺寸,并在\space每行和每列之间添加一个。

picture 的一个令人讨厌的方面是它使用自己的单位。在这种情况下,我使用\unitlength=1pt并使用\strip@pt(重命名\unit)将长度转换为图片单位。

\put单独创建每个标签相比,创建一排 es 更加容易\makebox

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[verbose,margin=0.1in]{geometry}

\makeatletter
\@ifundefined{unit}{\let\unit=\strip@pt}%
  {\errmessage{\string\unit\space already exists.}}
\makeatother

\begin{document}
    \begin{figure}
        \sbox1{% row 1
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}}%
        \sbox2{% row 2
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}}%
        \sbox3{% row 3
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}}%
        \sbox4{% row 4
            \includegraphics[trim=0.0cm 1.1cm 0 0,clip,width=0.249\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}
            \includegraphics[trim=1.1cm 1.1cm 0 0,clip,width=0.230\textwidth]{example-image}}%
        \setbox0=\vbox{\settowidth{\lineskip}{\space}%
            \hbox{\usebox1}
            \hbox{\usebox2}
            \hbox{\usebox3}
            \hbox{\usebox4}}%
        \unitlength=1pt
        \centering
        \begin{picture}(\unit\dimexpr \wd0+14pt\relax,\unit\dimexpr \ht0+14pt\relax)(0,0)
          \put(14,0){\usebox0}
          \put(10,\unit\dimexpr\ht0+4pt\relax) {\vector(1,0){\unit\dimexpr\wd0+4pt\relax}}
          \put(14,\unit\dimexpr\ht0+8pt\relax) {\makebox[0.249\textwidth]{label1}
            \makebox[0.230\textwidth]{label2}
            \makebox[0.230\textwidth]{label3}
            \makebox[0.230\textwidth]{label4}}
          \put(10,\unit\dimexpr\ht0+4pt\relax){\vector(0,-1){\unit\dimexpr\ht0+4pt\relax}}
          \put(0,0){\rotatebox[origin=Bl]{90}{\makebox[\ht4]{label8}
            \makebox[\ht3]{label7}
            \makebox[\ht2]{label6}
            \makebox[\ht1]{label5}}}
        \end{picture}
    \end{figure}
\end{document}

演示

相关内容