我有以下代码:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest,
yticklabel style={
/pgf/number format/.cd,
fixed,
precision=3,
fixed zerofill,
/tikz/.cd
},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ ]
\addplot coordinates {
(0.104544882,0.000270831)
(0.103353608,0.003183656)
(0.096670185,0.013470824)
};
\end{axis}
\end{tikzpicture}
\end{document}
我已经尝试过了
/pgf/number format/.cd,
fixed,
precision=3,
fixed zerofill,
/tikz/.cd
和
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=3,
/pgf/number format/fixed zerofill,
},
而且我无法将 y 轴刻度设为“0.000、0.005、0.010”,因此无法从 y 轴顶部移除 10^-2。有人知道如何解决这个问题吗?
谢谢
答案1
答案是添加到 \pgfplotsset scaled ticks = false。
代码
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest,
scaled ticks=false,
yticklabel style={
/pgf/number format/.cd,
fixed,
precision=3,
fixed zerofill,
/tikz/.cd
},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ ]
\addplot coordinates {
(0.104544882,0.000270831)
(0.103353608,0.003183656)
(0.096670185,0.013470824)
};
\end{axis}
\end{tikzpicture}
\end{document}
产量:
Pgfplots 手册第 4.15.3 节介绍了该内容,并在第 3.2.5 节中将其添加到代码中。我错误地忽略了它。