如何在 PGFPlots 上配置轴虚线?
\begin{axis}[grid=major]
%need grid=dashed
\end{axis}
答案1
您可以使用该grid style
选项(针对每条网格线)或major grid style
(针对每条主网格线):
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{grid style={dashed}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[grid=major]
%
\end{axis}
\end{tikzpicture}
\end{document}