[pstricks] log plot
Patrice Megret
Patrice.Megret at fpms.ac.be
Mon Oct 24 16:55:13 CEST 2005
Dear Herbert,
I have just loaded the latest beta version on pstricks website (version 2.70 2005/10/18) and here is the code below. You can see that there is a test on \ifx\psk at Ox\@empty ... in the test loop for the y axis. This causes a crash if Oy={} without specifying Ox.
Best regards,
Patrice
\def\psaxes at iv(#1,#2)(#3,#4)(#5,#6){%
\pst at killglue%
\begingroup%
\setbox\pst at hbox=\hbox\bgroup%
\use at par%
\pssetxlength\pst at dimg{#1}% o-x
\pssetylength\pst at dimh{#2}% o-y
\pssetxlength\pst at dima{#3}% bl-x
\pssetylength\pst at dimb{#4}% bl-y
\pssetxlength\pst at dimc{#5}% ur-x
\pssetylength\pst at dimd{#6}% ur-y
% If minimum values are negative in log mode, we modify Ox
% (respectively Oy) if this was not done by the user
% X axis labels (\psk at log = 0 or 1)
\ifx\psk at xlogBase\@empty\else%
\ifx\psk at Ox\@empty\else% we do nothing ... hv
\ifdim\psk at Ox pt=\z@
\ifdim#3pt<\z@
\pssetxlength\pst at dimg{#1}% o-x
\psset{Ox=#1}%
\fi
\fi%
\fi%
\fi%
% Y axis labels (\psk at log = 0 or 2)
\ifx\psk at ylogBase\@empty\else%
\ifx\psk at Ox\@empty\else
\ifdim#4pt<\z@
\ifdim\psk at Oy pt=\z@
\pssetylength\pst at dimh{#2}% o-y
\psset{Oy=#2}%
\fi
\fi
\fi
\fi
% Whole thing will be translated to origin:
\advance\pst at dima-\pst at dimg% Dist. from bl-x to o-x
\advance\pst at dimb-\pst at dimh% Dist. from bl-y to o-y
\advance\pst at dimc-\pst at dimg% Dist. from ur-x to o-x
\advance\pst at dimd-\pst at dimh% Dist. from ur-y to o-y
% Make lines/arrows or frame:
\@nameuse{psxs@\psk at axesstyle}% \psxs at axes or \psxs at frame
\ifPst at plot@yAxis%
\begingroup%
\ifdim\pst at dima=\z@\else\showoriginfalse\fi%
\ifnum\psk at dy=\z@%
\pst at dimg=\psk at Dy\psyunit%
\edef\psk at dy{\number\pst at dimg}%
\fi%
\ifPst at plot@xAxis\else\showorigintrue\fi%
\pst at vlabels{\pst at dimd}{\psk at arrowB}{#3}{#5}%
\ifPst at plot@xAxis\showoriginfalse\fi%
\pst at vlabels{\pst at dimb}{\psk at arrowA}{#3}{#5}%
\endgroup%
\fi%
\ifPst at plot@xAxis%
\begingroup%
\ifdim\pst at dimb=\z@\else\showoriginfalse\fi%
\ifnum\psk at dx=\z@%
\pst at dimg=\psk at Dx\psxunit%
\edef\psk at dx{\number\pst at dimg}%
\fi%
\ifPst at plot@yAxis\else\showorigintrue\fi%
\pst at hlabels{\pst at dimc}{\psk at arrowB}{#4}{#6}%
\ifPst at plot@yAxis\showoriginfalse\fi%
\pst at hlabels{\pst at dima}{\psk at arrowA}{#4}{#6}%
\endgroup%
\fi%
% Now close "\pst at hbox" (which is 0-dimensional), and put it at the origin.
\egroup%
\pssetxlength\pst at dimg{#1}%
\pssetylength\pst at dimh{#2}%
\leavevmode\psput at cartesian\pst at hbox%
\endgroup
\ignorespaces%
}
Prof Dr Ir Patrice Mégret
Head of Electromagnetism and Telecommunication Department
Faculté Polytechnique de Mons
Boulevard Dolez 31
B-7000 MONS
-----Message d'origine-----
De : pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] De la part de Herbert Voss
Envoyé : lundi 24 octobre 2005 16:25
À : pstricks at tug.org
Objet : Re: [pstricks] log plot
Patrice Megret wrote:
> By the way, if you prefer the way it is working now, could you just
> change the test in line 1447 which is \ifx\psk at Ox\@empty ... instead of
> \ifx\psk at y\@empty and causes thus a crash when Oy={} is specified and
> check the order of the tests which are different for x and y.
Patrice,
I didn't found such a line in the latest version.
Herbert
_______________________________________________
pstricks mailing list
pstricks at tug.org
http://tug.org/mailman/listinfo/pstricks
More information about the PSTricks
mailing list