如何使用 minipage 强制将标签置于 tikzpicture 下方的中心?

如何使用 minipage 强制将标签置于 tikzpicture 下方的中心?

我正在尝试调整解决方案(tikzpicture 并排) 放入我拥有的另一个 tikzpicture 图形中。两个标题均未在两个图形下方居中。

基本代码如下:

\documentclass{article}
\usepackage{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\sisetup{
    round-mode          = places,
    round-precision     = 2,
}
\begin{document}
\begin{figure}[!htp]
    \begin{minipage}[b]{0.40\textwidth}
        \centering
        \begin{tikzpicture}
            \begin{axis}[
                enlarge x limits=0.80,
                x tick label style={
                    /pgf/number format/1000 sep=},
                ylabel={Average Time (\unit{\second})},
                width = 6cm, height = 5cm,
                % width = 15.4cm, height = 10.7cm,
                grid=both,
                legend style={
                    font=\scriptsize,
                    cells={anchor=west}
                },
                legend pos=north west,
                symbolic x coords={Workload 1},
                xtick=data,
                tick label style={font=\normalsize},
                ybar,
                bar width = .8cm
                ]
                \addplot coordinates {(Workload 1, 9) (Workload 2, 13)};
                \addplot coordinates {(Workload 1, 9) (Workload 2, 13)};
                \legend{A,B}
            \end{axis}
        \end{tikzpicture}
        \caption{Paraboloide de}\label{pare}
    \end{minipage}\hfill %               <--- no blank line here
    \begin{minipage}[b]{0.4\textwidth}
        \centering
        \begin{tikzpicture}
            \begin{axis}[
                enlarge x limits=0.80,
                % enlarge y limits=0.05,
                x tick label style={
                    /pgf/number format/1000 sep=},
                ylabel={Average Time (\unit{\second})},
                width = 6cm, height = 5cm,
                % width = 15.4cm, height = 10.7cm,
                grid=both,
                legend style={
                    font=\scriptsize,
                    cells={anchor=west}
                },
                legend pos=north west,
                symbolic x coords={Workload 2},
                xtick=data,
                tick label style={font=\normalsize},
                ybar,
                bar width = .8cm
                ]
                \addplot coordinates {(Workload 1, 10) (Workload 2, 12)};
                \addplot coordinates {(Workload 1, 10) (Workload 2, 12)};
                \legend{A,B}
            \end{axis}
        \end{tikzpicture}
        \caption{Paraboloide }\label{pard}
    \end{minipage}
\end{figure}
\end{document}

输出如下:

在此处输入图片描述

两个图的标签看起来都有点左对齐。是否可以强制将每个图下的标签居中?

相关内容