[pstricks] small problem with psgraph

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri Oct 31 10:47:31 CET 2008


Patrice Mégret schrieb:

> I have a small trouble with psgraph environment. When I use \pscircle, \pswedge, \psarc the scaling is not correct.
> 
> No problem with \psellipse, \psframe, \psline.,


Patrice,
this is the default behaviour of _PSTricks_, it takes only the \psunit
into acount, but not \psxunit and \psyunit for the three makros.
Compare the following two examples. The first one will also be correct,
if you use \psset{unit=5cm}. And with \psgraph you can write simply
\let\psunit\psxunit (see example).

Herbert

\documentclass{article}
\usepackage{pstricks-add}
\begin{document}

\psset{xunit=5cm,yunit=5cm}
%\psset{unit=5cm}
\begin{pspicture}{->}(-1.1,-1.1)(1.1,1.1)
  \psaxes[Dx=0.2,Dy=0.2]{->}(0,0)(-1.1,-1.1)(1.1,1.1)
  \psarc[linecolor=green](0,0){1}{0}{90}
  \pscircle[linecolor=red]{1}
  \psellipse(1,0.5)
  \psline(1,1)(0,0.5)
  \psframe(0.5,0.5)(1,1)
  \pswedge[linecolor=blue]{1}{0}{45}
\end{pspicture}

\begin{psgraph}[Dx=0.2,Dy=0.2]{->}(0,0)(-1.1,-1.1)(1.1,1.1){10cm}{10cm}
  \let\psunit\psxunit
  \psarc[linecolor=green](0,0){1}{0}{90}
  \pscircle[linecolor=red]{1}
  \psellipse(1,0.5)
  \psline(1,1)(0,0.5)
  \psframe(0.5,0.5)(1,1)
  \pswedge[linecolor=blue]{1}{0}{45}
\end{psgraph}

\end{document}



More information about the PSTricks mailing list