[pstricks] Nested pspicture environment

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Jul 1 17:11:32 CEST 2009


Adam Fenn schrieb:
> How can one define a macro with nested \pspicture so that both have the same origin. My attempt below only works if the first two coordinates are 0. I assume the answer involves \rput but I don't know how to make it start in \mymacro and end in \endmymacro.

no need for the star version to clip your area.
use \psclip instead

\documentclass{article}
\usepackage{pst-plot}

\def\mymacro(#1,#2)(#3,#4){%
\pspicture[showgrid=true](#1,#2)(#3,#4)%
\psclip{\psframe[linestyle=none,
  linewidth=0pt](#1,#2)(#3,#4)}}

\def\endmymacro{%
\endpsclip%
\endpspicture}

\begin{document}


\mymacro(1,1)(3,3)
%\fileplot{mydata.dat}
\psdot(1,1)
\psdot(2,2)
\psdot(3,3)
\endmymacro

\end{document}

Herbert


More information about the PSTricks mailing list