Pgfplots:如何更改軸乘數符號

Pgfplots:如何更改軸乘數符號

我想手動定義與 x 軸相乘的符號。怎樣才能做到這樣呢?

例如:我想要 $\cdot \Delta_x$,而不是科學記數法 $\cdot 10^2$。

答案1

假設您實際上正在談論pgfplots(它是基於 TikZ 構建的,但與 TikZ 不同),您需要xtick scale label code/.code={$\cdot \Delta_{x}$}.

在此輸入影像描述

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
  domain=0:1e9,samples=2,
  xtick scale label code/.code={$\cdot \Delta_{x}$}
]
\addplot {1};
\end{axis}
\end{tikzpicture}
\end{document}

或者您可以關閉任何此類標籤,然後手動放置節點:

在此輸入影像描述

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
  domain=0:1e9,samples=2,
  xtick scale label code/.code={},
  name=ax
]
\addplot {1};
\end{axis}
\node [below left] at (ax.outer south east) {$\cdot \Delta_{x}$};
\end{tikzpicture}
\end{document}

相關內容