使用下面显示的代码,网格位于前景(可以在标签上看到红线......):
\documentclass[11pt]{article}
\usepackage[letterpaper, textwidth=7in, textheight=9.5in]{geometry}
\usepackage{amsfonts,amsmath,amssymb}
\usepackage{pstricks}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-5,-5)(5,5)
\psaxes[Ox=0,Oy=0,Dx=1,Dy=1,showorigin=false,tickstyle=top]{->}(0,0)(-5.5,-5.5)(5.5,5.5)
\psgrid[gridcolor=red,gridwidth=0.75pt,gridlabels=0,subgriddiv=5,subgridwidth=0.25pt](0,0)(-5,-5)(5,5)
\end{pspicture}
\end{document}
是否可以用轴来代替前景中的网格?
答案1
嗯,正如Paul Gessler
所说,只需要交换第 8 行和第 9 行。像这样
\documentclass[11pt]{article}
\usepackage[letterpaper, textwidth=7in, textheight=9.5in]{geometry}
\usepackage{amsfonts,amsmath,amssymb}
\usepackage{pstricks}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-5,-5)(5,5)
\psgrid[gridcolor=red,gridwidth=0.75pt,gridlabels=0,subgriddiv=5,subgridwidth=0.25pt](0,0)(-5,-5)(5,5)
\psaxes[Ox=0,Oy=0,Dx=1,Dy=1,showorigin=false,tickstyle=top]{->}(0,0)(-5.5,-5.5)(5.5,5.5)
\end{pspicture}
\end{document}
结果是