[pstricks] patch : autoscale y axis for psgraph
Martin Chicoine
martin.chicoine at umontreal.ca
Mon Aug 7 18:00:08 CEST 2006
>Martin Chicoine wrote:
>> I changed lines 2047 and 2072 of the \psgraph definition in pstricks.tex
>> to :
>>
>> \ifdim#6=0cm\pst at dima=\pst at tempA\pst at dimo\else\pst at dima=#6\fi\relax
>> and
>> \ifdim#8=0cm\pst at dima=\pst at tempA\pst at dimo\else\pst at dima=#8\fi\relax
>> , respectively.
>>
>> This allows to autoscale yLength (so that the scale of the x- and y-axis
>> are the same) if the user enters yLength=0cm.
>
>Please give a full working minimal example, where
>this maybe useful.
>
>Thanks
>Herbert
Here is an example where you don't have to calculate yLength in order to
have the same x- and y-scale. It is calculated automatically by setting
yLength to 0cm.
\documentclass{article}
\usepackage{pstricks-add-2}
\begin{document}
\psset{algebraic,subgriddiv=0}
\centering
\begin{psgraph}(0,0)(-4.5,-1.5)(3.5,3.5){.5\textwidth}{0cm}
\psplot{-2}{2}{x^2}
\end{psgraph}
\end{document}
Martin.
More information about the PSTricks
mailing list