# How to crop a pstricks figure

I wish to create a figure using pstricks code, and then to display only a cropped region of the figure. I thought that the arguments to \begin{pspicture}(...,...)(...,...) would allow me to do this, but changing those arguments seems to have no effect whatsoever on the output.

I am using TeXShop in OSX, so I suppose that compilation is via epstopdf and pdflatex, etc.

I would like a solution that does not involve exporting the figures to external files and then subsequently cropping. Currently 100% of the code to generate the .pdf is in the .tex file, and I hope to keep it that way.

-

## 2 Answers

I think you might be looking for

\begin{pspicture*}(xmin,ymin)(xmax,ymax)
...


Note the *

-

Use standalone class and compile the source with latex-dvips-ps2pdf sequence. You will get a tight standalone output as follows,

\documentclass[10pt,pstricks,border=12pt]{standalone}
\usepackage{pst-node}

\begin{document}

\begin{pspicture}[showgrid=bottom](-1,-1)(5,5)
\psframe[fillstyle=solid,fillcolor=yellow,opacity=0.1](-1,-1)(5,5)
\psdots[dotstyle=asterisk](0,0)
\psdots[dotstyle=o](1,1)
\psdots[dotstyle=triangle*](2,2)
\psdots[dotstyle=diamond*](3,3)
\psdots[dotstyle=pentagon*](4,4)
\end{pspicture}

\end{document}

-