正如本网站类似主题所建议的那样,我按照程序以十进制形式编写 x 标签。但是,它们仍然以科学计数法形式出现。这些是 10 ^ -3 量级的十进制数:也许这是 pgfplots 的限制?
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath,amssymb,amsfonts,systeme,mathtools}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}
\usepackage{pgfplots}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
legend pos=outer north east,
legend cell align={left},
grid, grid style=dashed,
ymin=1.50,ymax=2.75,
ytick={1.50,1.60,1.70,1.80,1.90,2.00,2.10,2.20,2.30,2.40,2.50,2.60},
xtick={0.0030,0.0031,0.0032,0.0033,0.0034},
xmax=0.0035,xmin=0.0030,
axis lines = middle,
set layers, % <---
x tick label style={
/pgf/number format/.cd,
fixed relative,
precision=5,
/tikz/.cd,
rotate=90
}
]
\addplot[color=orange,mark=*,mark options={solid,draw=orange,fill=orange},smooth]
coordinates {
(0.00341,2.67)(0.00335,2.44)(0.00330,2.24)(0.00324,2.06)(0.00319,1.88)(0.00314,1.72)(0.00309,1.56)
};
\addlegendentry{$x_1 = 0.3$};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
答案1
固定的
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath,amssymb,amsfonts,systeme,mathtools}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
legend pos=outer north east,
legend cell align={left},
grid, grid style=dashed,
ymin=1.50,ymax=2.75,
ytick={1.50,1.60,1.70,1.80,1.90,2.00,2.10,2.20,2.30,2.40,2.50,2.60},
xtick={0.0030,0.0031,0.0032,0.0033,0.0034},
xmax=0.0035,xmin=0.0030,
axis lines = middle,
set layers,
x tick label style={ %right code here
/pgf/number format/fixed,
/pgf/number format/precision=4,
/pgf/number format/fixed zerofill=true,
rotate=90
},
scaled x ticks=false,
y tick label style={
/pgf/number format/fixed,
/pgf/number format/precision=3,
},
]
\addplot[color=orange,mark=*,mark options={solid,draw=orange,fill=orange},smooth]
coordinates {
(0.00341,2.67)(0.00335,2.44)(0.00330,2.24)(0.00324,2.06)(0.00319,1.88)(0.00314,1.72)(0.00309,1.56)
};
\addlegendentry{$x_1 = 0.3$};
\end{axis}
\end{tikzpicture}
\end{document}