設定 pgfplot 的實際尺寸

設定 pgfplot 的實際尺寸

我正在嘗試在subfigure環境中繪製彩色直方圖。但是,當將圖表尺寸設為 時,\linewidth我得到了以下結果,這絕對不是我所期望的。

在此輸入影像描述

    \begin{subfigure}[t]{.48\linewidth}
    \begin{tikzpicture}
      \begin{axis}[
        width=\linewidth,
        height=.5\linewidth,
        yticklabels={},
      ]
        \addplot coordinates {(0,117)};
        \addplot coordinates {(1,1041)};
        \addplot coordinates {(10,2162)};
        \addplot coordinates {(11,776)};
      \end{axis}
    \end{tikzpicture}
    \caption{Histogram of $I_{sc}$}
  \end{subfigure}

我如何強制pgfplots佔據所有給定的空間/刪除填充/邊距/或其他任何內容?

如果scale only axis按照建議使用,邊距仍然存在,並且圖表會進入下一個子圖。

在此輸入影像描述

部分解決方案是設定ytick=\empty解決放置問題,但完全刪除刻度...

相關內容