# [pstricks] psgraph/pspicture variables psymax or numpsyunits

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu May 7 11:25:12 CEST 2009

Buddy Ledger schrieb:

> Does anyone know of an accessible parameter for the pspicture or psgraph
> environments which would report the dimensions of the environment.

psgraph claculates on TeX level the width and height of the box,
then psaxes is called with the values, and then

\def\psxs@@axes#1#2#3#4#5#6{% llx,lly,urx,ury,exch,x|y,arrowA,arrowB

this macro does all the calculations for the axes and it knows
the above values.

Herbert

> The application:
>
> I want to draw items (in postscript) which are scaled to the
> environment.  Say I want a legend at 0.75*total height and 0.75*total
> width.  If I change the plot limits I don't want to manually adjust the
> position idealy the position would be calculated automatically via
>
> 0.75 \psxmax mul  0.75 \psymax mul moveto
>
> I've assumed here that the imaginary psymax and psxunit are in the plot
> units not pts (if pts divide by psxunit and psyunit as appropriate).
>
> If these don't exist I may just redefine psgraph so that they are
> recording if the \def (I didn't see any indication that parameters of
> this type were provided) would there be any naming conflicts by adding
> the two parameters psxmax and psymax?