Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
1  
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. –  Who is crazy first Jan 5 '13 at 18:12

2 Answers 2

up vote 2 down vote accepted
\addtopsstyle{gridstyle}{gridlabels=0pt}


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

share|improve this answer

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.

enter image description here

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.