# How to hide grid labels without redefining the grid style?

I want to hide the grid labels without redefining the grid style, is it possible? Note: Redefining the grid style only for hiding the grid labels seems to be an overkill solution.

\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
%\newpsstyle{gridstyle}{gridlabels=0,% other redefinition goes here!}
\begin{pspicture}[showgrid=bottom,gridlabels=0](8,6)

\end{pspicture}
\end{document}


I know the following can be the answer, but how to do it without using \psgrid?

\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture}(8,6)
\psgrid[style=gridstyle,gridlabels=0]
\end{pspicture}
\end{document}

-
if you do not want labels then it is a redefinition of the grid style and I cannot see that this is a problem! –  Herbert Jan 5 '13 at 18:06
@Herbert: Redefinition wastes more keystrokes because many keys must be redefined to obtain the same settings that the original grid style settings has. –  cyanide-based food Jan 5 '13 at 18:12

\addtopsstyle{gridstyle}{gridlabels=0pt}


http://mirror.ctan.org/graphics/pstricks/base/doc/pst-news08.pdf

-

I could probably write you a better answer if I understood better what you're trying to do. But with that said, you could just use:

\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture*}[showgrid=bottom](8,6)

\psline[linecolor=red](0,0)(8,6)

\end{pspicture*}
\end{document}


The starred version of the environment gives you a clipped version.

But this solution assumes that there's nothing outside of the rectangle defined by (0,0) and (8,6) that you want to see.

Looking at the documentation in pst-news05, you can redefine the grid style that showgrid uses with the following line:

\newpsstyle{gridstyle}{subgriddiv=0,
gridcolor=lightgray,
griddots=10,
gridlabels=0pt}


I think this is probably preferable to clipping. For example, if you pass \psline[arrows=o-o](0,0)(8,6) in the clipped version, you'll get something suboptimal.

-