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 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.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

I think you might be looking for

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

Note the *

share|improve this answer

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

enter image description here

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