如何向表中添加轴类型标签?

如何向表中添加轴类型标签?

我有一张以下形式的图表:

它是使用如下代码制作的:

\begin{tabular}{r|ccc}
    & 2 & 3 & 4 \\
    \hline
    4 & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_4excl2excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_4excl3excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_4excl4excl.png} \\
    5 & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_5excl2excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_5excl3excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_5excl4incl.png} \\
    6 & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_6incl2excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_6incl3excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_6incl4incl.png} \\
\end{tabular}

我尝试了以下操作,但我认为这不是一个好方法,因为间距被打乱并且线条看起来很糟糕:

\begin{tabular}{r|ccc}
    &   & ${b}$ tags & \\
    & 2 & 3 & 4 \\
    \hline
    4 & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_4excl2excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_4excl3excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_4excl4excl.png} \\
    number of jets 5 & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_5excl2excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_5excl3excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_5excl4incl.png} \\
    6 & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_6incl2excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_6incl3excl.png} & \includegraphics[height=\measureISpecification]{PieCharts_HF/PieChart_6incl4incl.png} \\
\end{tabular}

有什么好方法可以做到这一点?

答案1

我没有使用\multirow,而是将旋转后的标签与上方和下方的空白行重叠。我还必须使用较小的字体才能使其适合。.748ex 的数字恰好是数字高度的 1/2。

\documentclass{standalone}
\usepackage{graphicx}
\usepackage{mwe}% provides example images (when installed)

\newcommand\measureISpecification{4ex}% not defined in mwe
\newcommand{\ctab}[1]{\raisebox{\dimexpr \measureISpecification/2 -.748ex}{#1}}% vertically centers numbers

\begin{document}
\begin{tabular}{rr|ccc}
   && \multicolumn{3}{c}{$b$ tags}\\
   && 2 & 3 & 4 \\
    \hline 
   &&\\[-2ex]% provides gap below \hline
   & \ctab{4} & \includegraphics[height=\measureISpecification]{example-image-a} & \includegraphics[height=\measureISpecification]{example-image-b} & \includegraphics[height=\measureISpecification]{example-image-c} \\
   \raisebox{\dimexpr \measureISpecification/2}[0pt][0pt]{\rotatebox[origin=c]{90}{\small number of jets}} & \ctab{5} & \includegraphics[height=\measureISpecification]{example-image-a} & \includegraphics[height=\measureISpecification]{example-image-b} & \includegraphics[height=\measureISpecification]{example-image-c} \\
   & \ctab{6} & \includegraphics[height=\measureISpecification]{example-image-a} & \includegraphics[height=\measureISpecification]{example-image-b} & \includegraphics[height=\measureISpecification]{example-image-c}
\end{tabular}
\end{document}

表格

相关内容