制作图表子图

制作图表子图

这个问题基于以下内容:

左侧每行一个标题的子图网格

但是,我想要的是制作一个图,其中包含与这些表类似的子图。具体来说,我正在寻找类似这样的内容:

在此处输入图片描述

因此,从某种意义上说,将解决方案放在上面链接中的每个子图中。此外,为每个小图添加标题(带有一些数值)。关于如何做到这一点,有什么建议吗?

答案1

只需将问题中给出的代码扩展为所需的列数和行数,即可轻松复制您的图像。使用tabularrayadjustbox包表格代码简单而简短:

\documentclass{article}
\usepackage{geometry}               % for set up page layout
\usepackage{tabularray}
\UseTblrLibrary{counter,varwidth}   % <===
\usepackage[skip=0.33\baselineskip]{subcaption} 
\usepackage[export]{adjustbox}      % <---

\begin{document}
    \begin{figure}[ht!]
\adjustboxset{width=\linewidth,
              valign=m
             }

\begin{tblr}{vline{5,8} = {1-5}{solid},
             colsep=2pt,
             colspec = {@{} r *{9}{X[c]} @{}},
             measure = vbox,
             hspan = minimal,
             }
    & coll 1 & coll 2 & coll 3  
                & coll 1 & coll 2 & coll 3  
                            & coll 1 & coll 2 & coll 3          \\
A 1 &   \adjincludegraphics{example-image-duck} 
        &   \adjincludegraphics{example-image-duck} 
            &  \adjincludegraphics{example-image-duck} 
                &   \adjincludegraphics{example-image-duck} 
                    &  \adjincludegraphics{example-image-duck} 
                        &  \adjincludegraphics{example-image-duck} 
                            &   \adjincludegraphics{example-image-duck} 
                                &  \adjincludegraphics{example-image-duck} 
                                    &  \adjincludegraphics{example-image-duck} 
                                                                \\
    & val a11 & val a12 & val a13
                & val b11 & val b12 & val b13
                            & val c11 & val c12 & val c13       \\
A 2  &   \adjincludegraphics{example-image-duck} 
        &   \adjincludegraphics{example-image-duck} 
            &  \adjincludegraphics{example-image-duck} 
                &   \adjincludegraphics{example-image-duck} 
                    &  \adjincludegraphics{example-image-duck} 
                        &  \adjincludegraphics{example-image-duck} 
                            &   \adjincludegraphics{example-image-duck} 
                                &  \adjincludegraphics{example-image-duck} 
                                    &  \adjincludegraphics{example-image-duck} 
                                                                \\
    & val a21 & val a22 & val a23
                & val b21 & val b22 & val b23
                            & val c21 & val c22 & val c23       \\
    &   \SetCell[c=3]{c}    \subcaption{x}  &   &
        &   \SetCell[c=3]{c}    \subcaption{xx} &   &
            &   \SetCell[c=3]{c}    \subcaption{xxx}    &   &   \\
\end{tblr}
\caption{Two rows of graphs}
\label{fig:fig1}
    \end{figure}
\end{document}

在此处输入图片描述

相关内容