From 31be7e2d49b9eb33e82ba1a3b9b05bcafce81282 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 17 Mar 2009 16:33:30 +0000 Subject: pstricks-add (16mar09) git-svn-id: svn://tug.org/texlive/trunk@12409 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/generic/pstricks-add/pstricks-add.tex | 183 +++++++++++---------- 1 file changed, 96 insertions(+), 87 deletions(-) (limited to 'Master/texmf-dist/tex/generic/pstricks-add') diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex index e86aaf65755..a6fcd0ad601 100644 --- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex +++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex @@ -1,4 +1,4 @@ -%% $Id: pstricks-add.tex 99 2009-03-03 10:37:34Z herbert $ +%% $Id: pstricks-add.tex 109 2009-03-16 11:24:38Z herbert $ %% %% %% This is file `pstricks-add.tex', @@ -29,8 +29,8 @@ \ifx\MultidoLoaded\endinput\else \input multido \fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi % -\def\fileversion{3.18} -\def\filedate{2009/03/03} +\def\fileversion{3.20} +\def\filedate{2009/03/16} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -1034,6 +1034,31 @@ \ignorespaces% } % +\def\tx@MovetoByHand{ tx@addDict begin MovetoByHand end } +\def\tx@LinetoByHand{ tx@addDict begin LinetoByHand end } +%/amplHand {.8} def +%/dtHand 2 def + +\def\pslineByHand{\pst@object{pslineByHand}} +\def\pslineByHand@i{% + \addbefore@par{VarStepEpsilon=2,varsteptol=0.8} + \pst@getarrows{% + \begin@OpenObj + \pst@getcoors[\pslineByHand@ii}} +\def\pslineByHand@ii{% + \addto@pscode{ + tx@addDict begin + /dtHand \psk@VarStepEpsilon\space def + /amplHand \psk@varsteptol\space def +% \pst@cp % current point + \tx@setlinejoin % hv 2007-10-13 + MovetoByHand + counttomark 2 div /maxLines ED + 1 1 maxLines { pop LinetoByHand } for + end + }% + \end@OpenObj% +} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%% %%%%%%%%%% @@ -1640,6 +1665,7 @@ %\psset@ticklines{none} \define@key[psset]{pstricks-add}{ylabelFactor}[\relax]{\def\psk@ylabelFactor{#1}} \define@key[psset]{pstricks-add}{xlabelFactor}[\relax]{\def\psk@xlabelFactor{#1}} +\define@boolkey[psset]{pstricks-add}[Pst@]{showOriginTick}[true]{}% %\psset{xlabelFactor=\relax,ylabelFactor=\relax}% %% #1 : optional arguments passed to psline @@ -1729,20 +1755,17 @@ \def\pst@tempA{#1}% \ifx\pst@tempA\@empty\the\@zero\else#1\fi% the integer part \def\pst@tempA{#2}% - \ifx\pst@tempA\@empty\@writeDecimals{}\else\@writeDecimals{#2}\fi% -} + \ifx\pst@tempA\@empty\@writeDecimals{}\else\@writeDecimals{#2}\fi} % \def\psxs@none{% \let\psk@arrowA\@empty% \let\psk@arrowB\@empty% - \psxs@axes% -} + \psxs@axes} % \def\psxs@axes{{% \ifPst@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}{x}\fi% - \ifPst@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}{y}\fi% -}} - + \ifPst@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}{y}\fi}} +% \def\psaxes{\pst@object{psaxes}} \def\psaxes@i{\pst@getarrows\psaxes@ii} \def\psaxes@ii(#1){\@ifnextchar({\psaxes@iii(#1)}{\psaxes@iv(0,0)(0,0)(#1)}} @@ -1990,7 +2013,7 @@ \def\pst@tempA{none}% \pst@addarrowdef% \addto@pscode{ - /showOrigin \ifshoworigin true \else false \fi def % 0 and ticks for 0/0 ? + /showOrigin \ifPst@showOriginTick true \else false \fi def % ticks for 0/0 ? \ifis@yAxis 0 \pst@number#4 \else \pst@number#3 0 \fi \ifis@yAxis 0 \pst@number#2 \else \pst@number#1 0 \fi ArrowA @@ -2060,8 +2083,8 @@ \else\@nameuse{psls@\psxsubticklinestyle}\fi stroke} def %\iffalse % start ticks --------------------------------------------------------- - showOrigin { 0 }{ dT } ifelse - dT MaxValue 1 add{ % the positive part of the axes +% showOrigin { 0 }{ dT } ifelse + 0 dT MaxValue 1 add { % the positive part of the axes /cntTick exch def % the index logLines { % log lines? gsave @@ -2085,12 +2108,12 @@ grestore % restore main tick status stroke /dsubT 0 def % no other subticks - } if % end logLines + } if % end logLines dsubT abs 0 gt { % du we have subticks? gsave % save graphic state % start subticks ---------------------------------------------------------- - /cntsubTick cntTick dsubT add def - subTNo 1 sub { + /cntsubTick cntTick dsubT add def + subTNo 1 sub { cntsubTick abs MaxValue abs le { % out of range? \ifis@yAxis \ifPst@maxyTicks true \else false \fi @@ -2109,29 +2132,32 @@ % end subticks ---------------------------------------------------------- grestore % restore tick status } if - gsave - \ifis@yAxis - \ifPst@maxyTicks true \else false \fi - \else - \ifPst@maxxTicks true \else false \fi - \fi - { cntTick minTickline #5 moveto - cntTick maxTickline #5 lineto } - { cntTick tickstart #5 moveto % line begin main Tick - cntTick tickend #5 lineto } ifelse % lineto tick end - Twidth SLW TColor % set line width and tick color - LSstroke - grestore + showOrigin { + gsave + \ifis@yAxis + \ifPst@maxyTicks true \else false \fi + \else + \ifPst@maxxTicks true \else false \fi + \fi + { cntTick minTickline #5 moveto + cntTick maxTickline #5 lineto } + { cntTick tickstart #5 moveto % line begin main Tick + cntTick tickend #5 lineto } ifelse % lineto tick end + Twidth SLW TColor % set line width and tick color + LSstroke + grestore + }{ /showOrigin true def } ifelse % only for the very first tick valid } for % end ticks ---------------------------------------------------------- %\fi %\iffalse % ================================================ % the other side + /showOrigin \ifPst@showOriginTick true \else false \fi def % ticks for 0/0 ? /dT dT neg def % the other side of the axis /dsubT dsubT neg def % start ticks ---------------------------------------------------------- - showOrigin { 0 }{ dT } ifelse - dT MinValue epsilon viceversa { add }{ sub } ifelse { +% showOrigin { 0 }{ dT } ifelse + 0 dT MinValue epsilon viceversa { add }{ sub } ifelse { /cntTick exch def logLines { % log lines? gsave @@ -2154,7 +2180,7 @@ subTwidth SLW subTColor % set line width and subtick color subLSstroke grestore - } + } % end loglines dsubT abs 0 gt { % do we have subticks? gsave % save main state % start subticks ---------------------------------------------------------- @@ -2171,12 +2197,14 @@ subLSstroke grestore % restore main state } if - gsave - cntTick tickstart #5 moveto % line begin main Tick - cntTick tickend #5 lineto % lineto tick end - Twidth SLW TColor % set line width and tick color - LSstroke - grestore + showOrigin { + gsave + cntTick tickstart #5 moveto % line begin main Tick + cntTick tickend #5 lineto % lineto tick end + Twidth SLW TColor % set line width and tick color + LSstroke + grestore + }{ /showOrigin true def } ifelse % only for the very first tick valid } for % end ticks ---------------------------------------------------------- %\fi @@ -2463,7 +2491,7 @@ % \def\psgraph{\pst@object{psgraph}} \def\psgraph@i{\pst@getarrows\psgraph@ii} -\def\psgraph@ii(#1,#2){\catcode`\!=12 +\def\psgraph@ii(#1,#2){\catcode`\!=12\relax \@ifnextchar({\psgraph@iii(#1,#2)}{\psgraph@iv(0,0)(#1,#2)}} \def\psgraph@iii(#1,#2)(#3,#4){\@ifnextchar({\psgraph@v(#1,#2)(#3,#4)}{\psgraph@iv(#1,#2)(#3,#4)}} % @@ -2471,39 +2499,29 @@ % minX | minY | maxX | maxY | Length x-axis | length y-axis% \pst@killglue% \begingroup% - \pst@dimo=#3\p@ - \pst@dimp=#1\p@ \multiply\pst@dimp by \m@ne + \pst@dimo=#3\p@\pst@dimp=#1\p@\multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta x - \pst@dimm=#5 - \pst@cntm=\pst@dimm - \pst@cntn=\pst@dimo - \divide\pst@cntm by \pst@cntn - \ifnum\pst@cntm=0 \pst@divide{\pst@dimm}{\pst@dimo}\pst@tempA - \pst@xunit=\pst@tempA\p@% - \else\pst@xunit=\pst@cntm\p@\fi -% - \pst@dimo=#4\p@ - \pst@dimp=#2\p@ \multiply\pst@dimp by \m@ne + \pst@dimm=#5% + \divide\pst@dimm by \strip@pt\pst@dimo% + \pst@xunit=\pst@dimm% +% + \pst@dimo=#4\p@\pst@dimp=#2\p@\multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta y - \ifx!#6 \pst@dimm=\pst@cntm\pst@dimo\else\pst@dimm=#6\fi - \pst@cntm=\pst@dimm - \pst@cntn=\pst@dimo - \divide\pst@cntm by \pst@cntn - \ifnum\pst@cntm=0 \pst@divide{\pst@dimm}{\pst@dimo}\pst@tempA - \pst@yunit=\pst@tempA\p@% - \else\pst@yunit=\pst@cntm\p@\fi + \ifx!#6\pst@dimm=\strip@pt\pst@dimm\pst@dimo\else\pst@dimm=#6\fi% + \divide\pst@dimm by \strip@pt\pst@dimo% + \pst@yunit=\pst@dimm% % - \pst@dimm=#1\pst@xunit + \pst@dimm=#1\pst@xunit% \advance\pst@dimm by \psk@llx% - \pst@dimn=#2\pst@yunit + \pst@dimn=#2\pst@yunit% \advance\pst@dimn by \psk@lly% - \pst@dimo=#3\pst@xunit + \pst@dimo=#3\pst@xunit% \advance\pst@dimo by \psk@urx% - \pst@dimp=#4\pst@yunit + \pst@dimp=#4\pst@yunit% \advance\pst@dimp by \psk@ury% - \if@star\pspicture*(\pst@dimm,\pst@dimn)(\pst@dimo,\pst@dimp)\else - \pspicture(\pst@dimm,\pst@dimn)(\pst@dimo,\pst@dimp)\fi - \psset{xunit=\pst@xunit,yunit=\pst@yunit} + \if@star\pspicture*(\pst@dimm,\pst@dimn)(\pst@dimo,\pst@dimp)\else% + \pspicture(\pst@dimm,\pst@dimn)(\pst@dimo,\pst@dimp)\fi% + \psset{xunit=\pst@xunit,yunit=\pst@yunit}% \bgroup% \use@par% \psaxes(#1,#2)(#3,#4)% @@ -2514,27 +2532,17 @@ % Xorig | yorig | minX | minY | maxX | maxY | Length x-axis | length y-axis% \pst@killglue% \begingroup% - \pst@dimo=#5\p@ - \pst@dimp=#3\p@ \multiply\pst@dimp by \m@ne + \pst@dimo=#5\p@\pst@dimp=#3\p@\multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta x - \pst@dimm=#7 - \pst@cntm=\pst@dimm - \pst@cntn=\pst@dimo - \divide\pst@cntm by \pst@cntn - \ifnum\pst@cntm=0 \pst@divide{\pst@dimm}{\pst@dimo}\pst@tempA - \pst@xunit=\pst@tempA\p@% - \else\pst@xunit=\pst@cntm\p@\fi -% - \pst@dimo=#6\p@ - \pst@dimp=#4\p@ \multiply\pst@dimp by \m@ne + \pst@dimm=#7% + \divide\pst@dimm by \strip@pt\pst@dimo% + \pst@xunit=\pst@dimm% +% + \pst@dimo=#6\p@\pst@dimp=#4\p@\multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta y - \ifx!#8 \pst@dimm=\pst@cntm\pst@dimo\else\pst@dimm=#8\fi - \pst@cntm=\pst@dimm - \pst@cntn=\pst@dimo - \divide\pst@cntm by \pst@cntn - \ifnum\pst@cntm=0 \pst@divide{\pst@dimm}{\pst@dimo}\pst@tempA - \pst@yunit=\pst@tempA\p@% - \else\pst@yunit=\pst@cntm\p@\fi + \ifx!#8\pst@dimm=\strip@pt\pst@dimm\pst@dimo\else\pst@dimm=#8\fi% + \divide\pst@dimm by \strip@pt\pst@dimo% + \pst@yunit=\pst@dimm% \iffalse \pst@dimo=#5\p@\advance\pst@dimo by -#3\p@% delta x \pst@divide{#7}{\pst@dimo}\pst@tempA% @@ -2583,11 +2591,11 @@ \def\psgraph@vi(#1,#2)(#3,#4)(#5,#6){% \ifx\psk@xAxisLabel\@empty\else% \ifx\psk@xAxisLabelPos\@empty \uput[0](#5,#2){\psk@xAxisLabel}% - \else \expandafter\setxLabelC@@r\psk@xAxisLabelPos(#3,#5)(#1,#2)\fi + \else \expandafter\setxLabelC@@r\psk@xAxisLabelPos(#3,#5)(#1,#2)\fi% \fi% \ifx\psk@yAxisLabel\@empty\else% \ifx\psk@yAxisLabelPos\@empty \uput[90](#1,#6){\psk@yAxisLabel}% - \else\expandafter\setyLabelC@@r\psk@yAxisLabelPos(#4,#6)(#1,#2)\fi + \else\expandafter\setyLabelC@@r\psk@yAxisLabelPos(#4,#6)(#1,#2)\fi% \fi% \ignorespaces% } @@ -3966,7 +3974,8 @@ braceWidthOuter=10\pslinewidth, chartNodeI=0.75, chartNodeO=1.5, - IQLfactor=1.5 + IQLfactor=1.5, + showOriginTick } \psset{% %%%% pstricks %%%%%%%% -- cgit v1.2.3