# Axes in the foreground with PSTricks

With the code shown below, the grid is on the foreground (one can see red lines on the labels...):

\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}


Is it possible to have the axes instead of the grid in the foreground?

• Just swap your two lines of code... (Draw the grid before the axes.) – Paul Gessler Aug 12 '14 at 2:02

Well as Paul Gessler said it only takes to swap the 8 and 9 lines. Like this

\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}


And the result is