以下是我得到的信息:
这是我的代码:
\documentclass{book}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\pgfplotstableread{
x y
1.3325 1535.5
1.3335 1537.82
1.3349 1540.92
1.3362 1543.62
1.3375 1546
}{\datatable}
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/.cd,
precision=5,
/tikz/.cd
}
]
\addplot+[] table [] {\datatable};
\end{axis}
\end{tikzpicture}
\end{document}
答案1
您在寻找吗xtick=data
?
\documentclass{book}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\pgfplotstableread{
x y
1.3325 1535.5
1.3335 1537.82
1.3349 1540.92
1.3362 1543.62
1.3375 1546
}{\datatable}
\begin{tikzpicture}
\begin{axis}[xtick=data,
x tick label style={
/pgf/number format/.cd,
precision=5,
/tikz/.cd
}
]
\addplot+[] table [] {\datatable};
\end{axis}
\end{tikzpicture}
\end{document}