# Is there a formula to setup the smallest rectangle enclosing a PSTricks grid and its labels?

I want to minimize the size of the red rectangle enclosing a PSTricks grid and its labels. How to do this?

\documentclass{minimal}
\usepackage{pstricks}
\newpsstyle{gridstyle}{gridlabels=5pt}
\psset{style=gridstyle}
\pagestyle{empty}

\begin{document}
\psframebox[linewidth=0.5pt,linecolor=red,framesep=5.5pt]{%
\begin{pspicture}[showgrid](3,3)
\pscircle[fillstyle=solid,fillcolor=red,opacity=0.2](1.5,1.5){1.5}
\end{pspicture}}
\end{document}

-

that is not possible; the labels with showgrid are written on PostScript level. With \psaxes you can write it into a box and then measure width and height.
How to make \psgrid and \psaxes exactly get overlapped one on the other? If you can do that, it is very helpful to measure the \psgrid box in advance. –  xport Jul 14 '11 at 21:04