From b863f2bfeab599875bf798ab734b9404f972625f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Jul 2013 23:29:02 +0000 Subject: pst-plot (10jul13) git-svn-id: svn://tug.org/texlive/trunk@31173 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-plot/Changes | 2 + .../doc/generic/pst-plot/more_docs/README | 3 - .../doc/generic/pst-plot/more_docs/dtk02-1.pdf | Bin 439324 -> 0 bytes .../doc/generic/pst-plot/more_docs/dtk02-2.pdf | Bin 141286 -> 0 bytes .../doc/generic/pst-plot/more_docs/tugboat01-4.pdf | Bin 114016 -> 0 bytes .../doc/generic/pst-plot/pst-plot-doc.pdf | Bin 1187115 -> 1188325 bytes .../doc/generic/pst-plot/pst-plot-doc.tex | 75 ++- .../texmf-dist/doc/generic/pst-plot/pst-plot97.tex | 642 --------------------- .../texmf-dist/tex/generic/pst-plot/pst-plot.tex | 41 +- 9 files changed, 109 insertions(+), 654 deletions(-) delete mode 100644 Master/texmf-dist/doc/generic/pst-plot/more_docs/README delete mode 100644 Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-1.pdf delete mode 100644 Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-2.pdf delete mode 100644 Master/texmf-dist/doc/generic/pst-plot/more_docs/tugboat01-4.pdf delete mode 100644 Master/texmf-dist/doc/generic/pst-plot/pst-plot97.tex (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/generic/pst-plot/Changes b/Master/texmf-dist/doc/generic/pst-plot/Changes index 3b081cd97d0..c33bc30f666 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/Changes +++ b/Master/texmf-dist/doc/generic/pst-plot/Changes @@ -1,4 +1,6 @@ ----- pst-plot.tex +1.47 2013-07-08 - added \psreadColumnData +1.46 2013-06-10 - fix bug with missing \relax in \get@label 1.45 2013-04-29 - fix for loglines with subticks>10 (pm) 1.44 2013-01-03 - take fontstyle into account for xLabels and yLabels 1.43 2012-11-17 - added keyword interrupt for interrupted diff --git a/Master/texmf-dist/doc/generic/pst-plot/more_docs/README b/Master/texmf-dist/doc/generic/pst-plot/more_docs/README deleted file mode 100644 index efdfe42fcfd..00000000000 --- a/Master/texmf-dist/doc/generic/pst-plot/more_docs/README +++ /dev/null @@ -1,3 +0,0 @@ -dtk02-1.pdf : Die mathematischen Funktionen von PostScript -dtk02-2.pdf : Die Plotfunktionen von pst-plot -tugboat01-4.pdf : The plot functions of pst-plot diff --git a/Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-1.pdf b/Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-1.pdf deleted file mode 100644 index 0fc4ce30313..00000000000 Binary files a/Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-1.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-2.pdf b/Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-2.pdf deleted file mode 100644 index 014508059ef..00000000000 Binary files a/Master/texmf-dist/doc/generic/pst-plot/more_docs/dtk02-2.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/generic/pst-plot/more_docs/tugboat01-4.pdf b/Master/texmf-dist/doc/generic/pst-plot/more_docs/tugboat01-4.pdf deleted file mode 100644 index eae65d2599b..00000000000 Binary files a/Master/texmf-dist/doc/generic/pst-plot/more_docs/tugboat01-4.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf index 86e4fa73063..49008f441e8 100644 Binary files a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf and b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf differ diff --git a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex index c17f64ea556..07a6e04cb21 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex @@ -110,6 +110,7 @@ contain units. The values of \Lcs{psxunit} and \Lcs{psyunit} are used as the uni \Lcs{psdataplot}\OptArgs\Largb{\Lcs{\Larga{macro}}}\\ \Lcs{savedata}\Largb{\Lcs{\Larga{macro}}}\Largs{data}\\ \Lcs{readdata}\Largb{\Lcs{\Larga{macro}}}\Largb{file}\\ + \Lcs{psreadColumnData}\Largb{colNo}\Largb{delimiter}\Largb{\Lcs{\Larga{macro}}}\Largb{filename}\\ \Lcs{listplot}\Largb{data}\\ \Lcs{pslistplot}\Largb{data} \end{BDef} @@ -363,6 +364,9 @@ is the black dot. \end{lstlisting} + + + The next example uses an external file for the data, which must first be read by the macro \Lcs{readdata}. The next one creates a horizontal boxplot by rotating the output with $-90$ degrees. @@ -407,6 +411,71 @@ the output with $-90$ degrees. \end{lstlisting} +It is also possible to read a data column from an external file: + + +\begin{filecontents*}{Data.dat} +98, 32 +20, 11 +79, 26 +14, 9 +23, 22 +21, 10 +58, 25 +13, 8 +19, 5 +53, 29 +41, 37 +11, 2 +83, 25 +71, 51 +10, 7 +89, 17 +10, 6 + , 41 + , 75 +\end{filecontents*} + +\begin{pspicture}(-1,-1)(5,6) +\psaxes[axesstyle=frame,dy=1cm,Dy=20,ticksize=4pt 0](0,0)(4,5) +\psreadDataColumn{1}{,}{\data}{Data.dat} +\rput(1,0){\psBoxplot[fillcolor=red!40,yunit=0.05]{\data}} +\psreadDataColumn{2}{,}{\data}{Data.dat} +\rput(3,0){\psBoxplot[fillcolor=blue!40,yunit=0.05]{\data}} +\end{pspicture} + +\begin{lstlisting} +\begin{filecontents*}{Data.dat} +98, 32 +20, 11 +79, 26 +14, 9 +23, 22 +21, 10 +58, 25 +13, 8 +19, 5 +53, 29 +41, 37 +11, 2 +83, 25 +71, 51 +10, 7 +89, 17 +10, 6 + , 41 + , 75 +\end{filecontents*} + +\begin{pspicture}(-1,-1)(5,6) +\psaxes[axesstyle=frame,dy=1cm,Dy=20,ticksize=4pt 0](0,0)(4,5) +\psreadDataColumn{1}{,}{\data}{Data.dat} +\rput(1,0){\psBoxplot[fillcolor=red!40,yunit=0.05]{\data}} +\psreadDataColumn{2}{,}{\data}{Data.dat} +\rput(3,0){\psBoxplot[fillcolor=blue!40,yunit=0.05]{\data}} +\end{pspicture} +\end{lstlisting} + @@ -739,6 +808,7 @@ can be outside of the visible \Lenv{pspicture} environment. \begin{LTXexample}[width=7cm] \psset{xAxisLabel=,yAxisLabel=, llx=-5mm,urx=1cm,lly=-5mm, + mathLabel=false, xLabels={A,b,C,d,E,f,}, xlabelsep=-5pt} \begin{psgraph}{->}(5,5){6cm}{6cm} @@ -1052,8 +1122,9 @@ redefinition, then do it for \Lcs{pst@@@hlabel} and \begin{LTXexample}[pos=b] \psset{xunit=0.75} \begin{pspicture}(-2,-2)(14,4) -\psaxes[xLabels={,Kerry,Laois,London,Waterford,Clare,Offaly,Galway,Wexford,Dublin,% - Limerick,Tipperary,Cork,Kilkenny},xLabelsRot=45,yLabels={,low,medium,high}](14,4) +\psaxes[xLabels={,Kerry,Laois,London,Waterford,Clare,Offaly,Galway,Wexford,% + Dublin,Limerick,Tipperary,Cork,Kilkenny},xLabelsRot=45, + yLabels={,low,medium,high},mathLabel=false](14,4) \end{pspicture} \end{LTXexample} diff --git a/Master/texmf-dist/doc/generic/pst-plot/pst-plot97.tex b/Master/texmf-dist/doc/generic/pst-plot/pst-plot97.tex deleted file mode 100644 index c72ea79624a..00000000000 --- a/Master/texmf-dist/doc/generic/pst-plot/pst-plot97.tex +++ /dev/null @@ -1,642 +0,0 @@ -%% BEGIN pst-plot.tex -\def\fileversion{0.93a-patch2} -\def\filedate{94/09/19} -%% -%% This is for use with PSTricks v0.93a, but contains several -%% patches for bugs in the pst-plot.tex that was distributed -%% with v0.93a until March 30, 1994. -%% -%% For plots and axes with PSTricks. -%% -%% COPYRIGHT 1993, by Timothy Van Zandt, tvz@Princeton.EDU -%% See pstricks.doc or pstricks.tex for copying restrictions. -%% -%% See the PSTricks read-me file and the User's Guide for documentation. - - -\message{ v\fileversion, \filedate} - -\csname PSTplotLoaded\endcsname -\let\PSTplotLoaded\endinput - -\ifx\PSTricksLoaded\endinput\else - \def\next{\input pstricks97.tex } - \expandafter\next -\fi - -\ifx\MultidoLoaded\endinput\else - \def\next{\input multido.tex } - \expandafter\next -\fi - -\edef\TheAtCode{\the\catcode`\@} -\catcode`\@=11 - -% Using lists of data is optimized for \dataplot and \fileplot -% Here is the tricky part. As each line is read from file, -% we want to ignore trailing delimiters, and convert arbitrary -% strings of non-trailing delimiters to _D_. -% We end up with -% D x1 D y1 D x2 D y2 ... D xn D yn -% -\begingroup -\catcode`\{=13 -\catcode`\}=13 -\catcode`\(=13 -\catcode`\)=13 -\catcode`\,=13 -\catcode`\!=1 -\catcode`\*=2 -\catcode`\ =13 -\catcode`\_=13 -\catcode`\^^M=13 -\gdef\pst@datadelimiters!% Begin def -\catcode`\{=13% -\catcode`\}=13% -\catcode`\(=13% -\catcode`\)=13% -\catcode`\,=13% -\catcode`\ =13% -\catcode`\^^M=13% -\def,##1!% -\ifcat\noexpand,\noexpand##1% -\expandafter##1% -\else\space% -D\space##1% -\fi*% -\let(,\let),\let{,\let},\let ,\let^^M,\let_\@empty*% End def -\endgroup -\begingroup -\catcode`\,=13 -\catcode`\_=13 -\gdef\savedata@#1[#2]{% - \xdef\pst@tempg{#2_}% - \endgroup - \let#1\pst@tempg - \global\let\pst@tempg\relax - \ignorespaces} -\gdef\readdata@{% - \read1 to \pst@tempa - \expandafter\readdata@@\pst@tempa_\@nil - \ifeof1\else\expandafter\readdata@\fi} -\gdef\pst@@readfile#1#2\@nil{\addto@pscode{,#1#2}}% -\gdef\readdata@@#1#2\@nil{\xdef\pst@tempg{\pst@tempg,#1#2}}% -\endgroup - -\def\readdata#1#2{% - \openin1=#2 - \begingroup - \def\pst@tempg{}% - \ifeof1 - \@pstrickserr{Data file `#2' not found.}\@ehpa - \else - \pst@datadelimiters - \catcode`\[=1 - \catcode`\]=2 - \readdata@% - \fi - \endgroup - \let#1\pst@tempg - \global\let\pst@tempg\relax - \ignorespaces} - -\def\pst@readfile#1{{\let\readdata@@\pst@@readfile\readdata\pst@tempg{#1}}} -\def\pst@altreadfile#1{% - \openin1=#1 - \ifeof1 - \@pstrickserr{Data file `#1' not found.}\@ehpa - \else - \catcode`\{=10 - \catcode`\}=10 - \catcode`\(=10 - \catcode`\)=10 - \catcode`\,=10 - \catcode`\^^M=10 - \catcode`\[=1 - \catcode`\]=2 - \pst@@altreadfile - \fi} -\def\pst@@altreadfile{% - \read1 to \pst@tempg - \expandafter\pst@@@altreadfile\pst@tempg\@empty\@nil - \ifeof1\else\expandafter\pst@@@altreadfile\fi} -\def\pst@@@altreadfile#1#2\@nil{\addto@pscode{#1#2}}% - -\def\savedata#1{\begingroup\pst@datadelimiters\savedata@{#1}} - -\def\beginplot@line{\begin@OpenObj} -\def\endplot@line{\psline@ii} -\def\beginplot@polygon{\begin@ClosedObj} -\def\endplot@polygon{\pspolygon@ii} -\def\beginplot@curve{\begin@OpenObj} -\def\endplot@curve{\pscurve@ii} -\def\beginplot@ecurve{\begin@OpenObj} -\def\endplot@ecurve{\psecurve@ii} -\def\beginplot@ccurve{\begin@ClosedObj} -\def\endplot@ccurve{\psccurve@ii} -\def\beginplot@dots{\begin@SpecialObj} -\def\endplot@dots{\psdots@ii} -\def\beginplot@bezier{\begin@OpenObj} -\def\endplot@line{\psbezier@ii} -\def\beginplot@cbezier{\begin@ClosedObj} -\def\endplot@cbezier{\pscbezier@ii} - -\def\psset@plotstyle#1{% - \@ifundefined{beginplot@#1}% - {\@pstrickserr{Plot style `#1' not defined}\@eha}% - {\edef\psplotstyle{#1}}} -\psset@plotstyle{line} - -\def\psset@plotpoints#1{% - \pst@cntg=#1\relax - \ifnum\pst@cntg<2 - \@pstrickserr{plotpoints parameter must be at least 2}\@ehpa - \else - \advance\pst@cntg-1 - \edef\psk@plotpoints{\the\pst@cntg\space}% - \fi} -\psset@plotpoints{50} - -% For quick plots, define: -% \beginqp@ : What to do to first point (PS code only). -% \doqp@ : What to do to subsequent points (PS code only). -% \endqp@ : How to end plot. -% \testqp@ : Set \@psttrue if OK to use quick plot. - -\def\beginqp@line{\pst@oplineto} -\def\doqp@line{L } -\def\endqp@line{\end@OpenObj}% -\def\testqp@line{% - \ifdim\pslinearc>\z@\else - \ifshowpoints\else - \ifx\psk@arrowA\@empty - \ifx\psk@arrowB\@empty - \@psttrue - \fi - \fi - \fi - \fi} - -\def\beginqp@polygon{moveto } -\def\doqp@polygon{L } -\def\endqp@polygon{% - \addto@pscode{closepath}% - \end@ClosedObj} -\def\testqp@polygon{% - \ifdim\pslinearc>\z@\else - \ifshowpoints\else - \@psttrue - \fi - \fi} - -\def\beginqp@dots{% - \psk@dotsize - \@nameuse{psds@\psk@dotstyle} - Dot } -\def\doqp@dots{Dot } -\def\endqp@dots{\end@SpecialObj} -\def\testqp@dots{\@psttrue} - -\def\beginqp@bezier{/n 0 def \pst@oplineto} -\def\doqp@bezier{/n n 1 add def n 3 mod 0 eq { curveto } if } -\def\endqp@bezier{% - \addto@pscode{n 3 mod { pop pop } repeat} - \end@OpenObj}% -\def\testqp@bezier{% - \ifshowpoints\else - \ifx\psk@arrowA\@empty - \ifx\psk@arrowB\@empty - \@psttrue - \fi - \fi - \fi} - -\def\beginqp@cbezier{/n 0 def moveto } -\def\doqp@cbezier{\doqp@bezier} -\def\endqp@cbezier{% - \addto@pscode{n 3 mod { pop pop } repeat closepath} - \end@ClosedObj}% -\def\testqp@cbezier{\ifshowpoints\else\@psttrue\fi} - -\def\dataplot{\def\pst@par{}\pst@object{dataplot}} -\def\dataplot@i#1{% - \pst@killglue - \begingroup - \use@par - \@pstfalse - \@nameuse{testqp@\psplotstyle}% - \if@pst - \dataplot@ii{\addto@pscode{#1}}% - \else - \listplot@ii{\addto@pscode{#1}}% - \fi - \endgroup - \ignorespaces} -\def\dataplot@ii#1{% - \@nameuse{beginplot@\psplotstyle}% - \addto@pscode{% - /Dx { \pst@number\psxunit mul /D { Dy } def } def - /Dy { \pst@number\psyunit mul Do /D { Dx } def } def - /D { /D { Dx } def } def - /Do { - \@nameuse{beginqp@\psplotstyle}% - /Do { \@nameuse{doqp@\psplotstyle}} def - } def}% - #1% - \addto@pscode{D}% - \@nameuse{endqp@\psplotstyle}} - -\def\fileplot{\def\pst@par{}\pst@object{fileplot}} -\def\fileplot@i#1{% - \pst@killglue - \begingroup - \use@par - \@pstfalse - \@nameuse{testqp@\psplotstyle}% - \if@pst - \dataplot@ii{\pst@readfile{#1}}% - \else - \listplot@ii{\pst@altreadfile{#1}}% - \fi - \endgroup - \ignorespaces} - -\pst@def{ScalePoints}<% - /y ED /x ED - counttomark dup dup cvi eq not { exch pop } if - /m exch def /n m 2 div cvi def - n { y mul m 1 roll x mul m 1 roll /m m 2 sub def } repeat> - -\def\listplot{\def\pst@par{}\pst@object{listplot}} -\def\listplot@i#1{\listplot@ii{\addto@pscode{#1}}} -\def\listplot@ii#1{% - \@nameuse{beginplot@\psplotstyle}% - \addto@pscode{/D {} def mark}% - #1% - \addto@pscode{\pst@number\psxunit \pst@number\psyunit \tx@ScalePoints}% - \@nameuse{endplot@\psplotstyle}} - -% \psplot - -\def\psplotinit#1{\xdef\psplot@init{#1 }} -\def\psplot@init{} - -\def\psplot{\def\pst@par{}\pst@object{psplot}} -\def\psplot@i#1#2#3{% - \pst@killglue - \begingroup - \use@par - \@nameuse{beginplot@\psplotstyle}% - \addto@pscode{% - \psplot@init - /x #1 def - /x1 #2 def - /dx x1 x sub \psk@plotpoints div def - /xy { - x \pst@number\psxunit mul - #3 \pst@number\psyunit mul - } def}% - \gdef\psplot@init{}% - \@pstfalse - \@nameuse{testqp@\psplotstyle}% - \if@pst - \psplot@ii - \else - \psplot@iii - \fi - \endgroup - \ignorespaces} -\def\psplot@ii{% - \addto@pscode{% - xy \@nameuse{beginqp@\psplotstyle} - \psk@plotpoints 1 sub { - /x x dx add def - xy \@nameuse{doqp@\psplotstyle} - } repeat - /x x1 def - xy \@nameuse{doqp@\psplotstyle}}% - \@nameuse{endqp@\psplotstyle}} -\def\psplot@iii{% - \addto@pscode{% - mark - /n 2 def - \psk@plotpoints { - xy - n 2 roll - /n n 2 add def - /x x dx add def - } repeat - /x x1 def - xy - n 2 roll}% - \@nameuse{endplot@\psplotstyle}} - -\def\parametricplot{\def\pst@par{}\pst@object{parametricplot}} -\def\parametricplot@i#1#2#3{% - \pst@killglue - \begingroup - \use@par - \@nameuse{beginplot@\psplotstyle}% - \addto@pscode{% - \psplot@init - /t #1 def - /t1 #2 def - /dt t1 t sub \psk@plotpoints div def - /xy { - #3 - \pst@number\psyunit mul exch - \pst@number\psxunit mul exch - } def}% - \gdef\psplot@init{}% - \@pstfalse - \@nameuse{testqp@\psplotstyle}% - \if@pst - \parametricplot@ii - \else - \parametricplot@iii - \fi - \endgroup - \ignorespaces} -\def\parametricplot@ii{% - \addto@pscode{% - xy \@nameuse{beginqp@\psplotstyle} - \psk@plotpoints 1 sub { - /t t dt add def - xy \@nameuse{doqp@\psplotstyle} - } repeat - /t t1 def - xy \@nameuse{doqp@\psplotstyle}}% - \@nameuse{endqp@\psplotstyle}} -\def\parametricplot@iii{% - \addto@pscode{% - mark - /n 2 def - \psk@plotpoints { - xy - n 2 roll - /n n 2 add def - /t t dt add def - } repeat - /t t1 def - xy - n 2 roll}% - \@nameuse{endplot@\psplotstyle}} - -% These axes macros are complicated. Be careful. - -% \pst@ticks{angle}{dx}{n}{int} -% int=1 if ticks appear on top of axes, 0 otherwise. -\def\pst@ticks#1#2#3#4{% - \begin@SpecialObj - \addto@pscode{% - #1 rotate - /n #3 def - /dx #2 def - n 0 lt { /dx dx neg def /n n neg def } if - /y2 \psk@ticksize CLW 2 div add def - /y1 y2 neg def - \ifnum\psk@tickstyle=1 - \ifdim#4<\z@ /y2 \else /y1 \fi 0 def - \else - \ifnum\psk@tickstyle=-1 - \ifdim#4<\z@ /y1 \else /y2 \fi 0 def - \fi - \fi - /x dx def - n { x y1 moveto x y2 lineto stroke /x x dx add def } repeat}% - \end@SpecialObj} - - -\def\psset@ticksize#1{\pst@getlength{#1}\psk@ticksize} -\psset@ticksize{3pt} - -\def\psset@tickstyle#1{\pst@expandafter\psset@@tickstyle{#1}\@nil} -\def\psset@@tickstyle#1#2\@nil{% - \ifx#1f\let\psk@tickstyle\z@\else - \ifx#1t\let\psk@tickstyle\@ne\else - \ifx#1b\let\psk@tickstyle\m@ne\else - \@pstrickserr{Bad tick style: `#1#2'}\@ehpa - \fi\fi\fi} -\psset@tickstyle{full} - -\def\psset@ticks#1{\pst@expandafter\psset@@ticks{#1}\@nil\psk@ticks} -\def\psset@@ticks#1#2\@nil#3{% - \ifx#1a\let#3\z@\else - \ifx#1x\let#3\@ne\else - \ifx#1y\let#3\tw@\else - \ifx#1n\let#3\thr@@\else - \@pstrickserr{Bad argument: `#1#2'}\@ehpa - \fi\fi\fi\fi} -\psset@ticks{all} - -\def\psset@labels#1{\pst@expandafter\psset@@ticks{#1}\@nil\psk@labels} -\psset@labels{all} - -\def\psset@Ox#1{\edef\psk@Ox{#1}} -\psset@Ox{0} -\def\psset@Dx#1{\edef\psk@Dx{#1}} -\psset@Dx{1} -\def\psset@dx#1{% - \pssetxlength\pst@dimg{#1}% - \edef\psk@dx{\number\pst@dimg}} -\psset@dx{0} - -\def\psset@Oy#1{\edef\psk@Oy{#1}} -\psset@Oy{0} -\def\psset@Dy#1{\edef\psk@Dy{#1}} -\psset@Dy{1} -\def\psset@dy#1{% - \pssetylength\pst@dimg{#1}% - \edef\psk@dy{\number\pst@dimg}} -\psset@dy{0} - -\newif\ifshoworigin -\def\psset@showorigin#1{\@nameuse{showorigin#1}} -\psset@showorigin{true} - - -\def\psaxes{\def\pst@par{}\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)}} -\def\psaxes@iii(#1)(#2){% - \@ifnextchar(% - {\psaxes@iv(#1)(#2)}% - {\psaxes@iv(#1)(#1)(#2)}} -\def\psaxes@iv(#1,#2)(#3,#4)(#5,#6){% - \setbox\pst@hbox=\hbox\bgroup - \use@par - \pssetxlength\pst@dimg{#1}% o-x - \pssetylength\pst@dimh{#2}% o-y - \pssetxlength\pst@dima{#3}% bl-x - \pssetylength\pst@dimb{#4}% bl-y - \pssetxlength\pst@dimc{#5}% ur-x - \pssetylength\pst@dimd{#6}% ur-y -% Whole thing will be translated to origin: - \advance\pst@dima-\pst@dimg % Dist. from bl-x to o-x - \advance\pst@dimb-\pst@dimh % Dist. from bl-y to o-y - \advance\pst@dimc-\pst@dimg % Dist. from ur-x to o-x - \advance\pst@dimd-\pst@dimh % Dist. from ur-y to o-y -% Make lines/arrows or frame: - \@nameuse{psxs@\psk@axesstyle}% -% "\pslabelsep" should be from the edge of the axis. - \advance\pslabelsep.5\pslinewidth -% Now the ticks and labels. Start by checking for "\multido". -% !!Need to fix this so that does nothing when there are 0 ticks.!! - \begingroup - \ifdim\pst@dimb=\z@\else\showoriginfalse\fi - \ifnum\psk@dx=\z@ - \pst@dimg=\psk@Dx\psxunit - \edef\psk@dx{\number\pst@dimg}% - \fi - \ifnum\psk@ticks<\tw@ - \ifnum\psk@tickstyle>\z@\else - \advance\pslabelsep\psk@ticksize\p@ - \fi - \fi - \pst@hlabels\pst@dimc\psk@arrowB - \pst@hlabels\pst@dima\psk@arrowA - \endgroup - \begingroup - \ifdim\pst@dima=\z@\else\showoriginfalse\fi - \ifnum\psk@dy=\z@ - \pst@dimg=\psk@Dy\psyunit - \edef\psk@dy{\number\pst@dimg}% - \fi - \ifodd\psk@ticks\else - \ifnum\psk@tickstyle>\z@\else - \advance\pslabelsep\psk@ticksize\p@ - \fi - \fi - \pst@vlabels\pst@dimd\psk@arrowB - \pst@vlabels\pst@dimb\psk@arrowA - \endgroup -% Now close "\pst@hbox" (which is 0-dimensional), and put it at the origin. - \egroup - \pssetxlength\pst@dimg{#1}% - \pssetylength\pst@dimh{#2}% - \leavevmode\psput@cartesian\pst@hbox - \ignorespaces} - -\def\psxs@axes{% - \psxs@@axes\pst@dima\pst@dimc{}% - \psxs@@axes\pst@dimb\pst@dimd{exch}} -\def\psxs@@axes#1#2#3{% - \begin@SpecialObj - \ifdim#1=\z@ - \def\psk@arrowA{C}% - \else - \ifdim#2=\z@ - \def\psk@arrowB{C}% - \fi - \fi - \let\pst@linetype\pst@arrowtype - \pst@addarrowdef - \addto@pscode{% - \pst@number#2 0 #3 - \pst@number#1 0 #3 - ArrowA - CP 4 2 roll - ArrowB - L - pop pop}% - \pst@stroke - \end@SpecialObj} - -\def\psxs@frame{% - \begin@SpecialObj - \addto@pscode{% - 0 0 moveto \pst@number\pst@dimc 0 L - 0 \pst@number\pst@dimd 2 copy rlineto L closepath}% - \pst@stroke - \pst@fill - \end@SpecialObj - \let\psk@arrowA\@empty - \let\psk@arrowB\@empty} - -\def\psset@axesstyle#1{% - \@ifundefined{psxs@#1}% - {\@pstrickserr{Axes style `#1' not defined}\@eha}% - {\edef\psk@axesstyle{#1}}} -\psset@axesstyle{axes} -\def\psxs@none{\let\psk@arrowA\@empty\let\psk@arrowB\@empty} - -% The origin is never the only label. -\def\pst@hlabels#1#2{% - \ifdim#1=\z@\else - \ifx#2\empty\else - \advance#1\ifdim#1>\z@-\fi7\pslinewidth - \fi - \pst@cnta=#1\relax % Distance (in sp) to end. - \divide\pst@cnta\psk@dx\relax % Number of ticks/labels - \ifnum\pst@cnta=\z@\else - \pst@dimb=\psk@dx sp % Space between ticks. - \ifnum\psk@ticks<\tw@ - \pst@ticks{0}{\pst@number\pst@dimb}{\the\pst@cnta}{\pst@dimd}% - \fi - \ifnum\psk@labels<\tw@ \pst@@hlabels\fi - \showoriginfalse - \fi - \fi} - -% Knows \pst@dimb and \pst@cnta -\def\pst@@hlabels{% - \vbox to\z@{% - \ifdim\pst@dimd>\z@\vskip\pslabelsep\else\vss\fi - \ifnum\pst@cnta<\z@ - \pst@dimb=-\pst@dimb - \fi - \hbox to\z@{% - \ifshoworigin\hbox to \z@{\hss\pshlabel{\psk@Ox}\hss}\fi - \mmultido - {\n=\psk@Ox+\psk@Dx}% - {\pst@cnta}% - {\hskip\pst@dimb\hbox to \z@{\hss\pshlabel{\n}\hss}}% - \hss}% - \ifdim\pst@dimd>\z@\vss\else\vskip\pslabelsep\fi}}% - -\def\pshlabel#1{$#1$} - -\def\pst@vlabels#1#2{% - \ifdim#1=\z@\else - \ifx#2\empty\else - \advance#1\ifdim#1>\z@-\fi7\pslinewidth - \fi - \pst@cnta=#1\relax % Distance (in sp) to end. - \divide\pst@cnta\psk@dy\relax % Number of ticks/labels - \ifnum\pst@cnta=\z@\else - \pst@dima=\psk@dy sp % Space between ticks. - \ifodd\psk@ticks\else - \pst@ticks{90}{\pst@number\pst@dima}{\the\pst@cnta}{-\pst@dimc}% - \fi - \ifodd\psk@labels\else\pst@@vlabels\fi - \showoriginfalse - \fi - \fi} - -% Knows \pst@dima and \pst@cnta -\def\pst@@vlabels{% - \vbox to\z@{% - \ifnum\pst@cnta>\z@ - \pst@dima=-\pst@dima - \fi - \offinterlineskip - \ifshoworigin - \vbox to \z@{\vss\hbox to\z@{% - \ifdim\pst@dimc>\z@\hss\else\hskip\pslabelsep\fi - \psvlabel{\psk@Oy}% - \ifdim\pst@dimc>\z@\hskip\pslabelsep\else\hss\fi}\vss}% - \fi - \mmultido - {\n=\psk@Oy+\psk@Dy}% - {\pst@cnta}% - {\vbox to\pst@dima{\vss}\vbox to \z@{\vss\hbox to\z@{% - \ifdim\pst@dimc>\z@\hss\else\hskip\pslabelsep\fi - \psvlabel{\n}% - \ifdim\pst@dimc>\z@\hskip\pslabelsep\else\hss\fi}\vss}}% - \vss}} - -\def\psvlabel#1{$#1$} - -\catcode`\@=\TheAtCode\relax -\endinput -%% pst-plot.tex diff --git a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex index 3ba69d200c1..5389d51c181 100644 --- a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex +++ b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex @@ -1,4 +1,4 @@ -% $Id: pst-plot.tex 776 2013-04-29 10:10:22Z herbert $ +% $Id: pst-plot.tex 802 2013-07-09 20:24:11Z herbert $ %% BEGIN pst-plot.tex %% %% plotting functions and data with PSTricks. @@ -20,8 +20,8 @@ \ifx\PSTFPloaded\endinput\else \input pst-fp.tex \fi \ifx\MultidoLoaded\endinput\else \input multido.tex \fi % -\def\fileversion{1.45} -\def\filedate{2013/04/29} +\def\fileversion{1.47} +\def\filedate{2013/07/08} \message{ v\fileversion, \filedate\space (tvz,hv)} % \edef\TheAtCode{\the\catcode`\@} @@ -152,6 +152,36 @@ D\space##1% % \def\savedata#1{\begingroup\pst@datadelimiters\savedata@{#1}} % +\newread\RCD@file +\def\psreadDataColumn#1#2#3#4{% #1:column #2:delimiter #3:\result #4:data file + \immediate\openin\RCD@file=#4\relax + \global\let#3=\@empty + \loop + \read\RCD@file to \@tempa + \ifeof\RCD@file\else + %%%\typeout{*** \@tempa ***}% + \edef\@tempa{\@tempa#2}% + \def\reserved@b{}% + \@tempswafalse + \@tempcnta=#1\relax + \expandafter\@tfor\expandafter\reserved@a + \expandafter:\expandafter=\@tempa\do{% loop over every token + \if\reserved@a#2\relax% delimiter? + \advance\@tempcnta \m@ne + \ifnum \@tempcnta=\z@ + \expandafter\g@addto@macro\expandafter#3\expandafter{\reserved@b\space}% + \@tempswatrue + \fi + \def\reserved@b{}% ??? + \else + \edef\reserved@b{\reserved@b\reserved@a} + \fi + \if@tempswa\@break@tfor\fi + }% + \repeat + \immediate\closein\RCD@file +} + %%%%%%%%%%%%%% the plot-styles %%%%%%%%%%%%%%%%%% % \def\beginplot@line{\begin@OpenObj} @@ -1985,9 +2015,6 @@ D\space##1% \ignorespaces% }% % -% -% -% \def\psxs@frame{% \begin@SpecialObj% \addto@pscode{ % the frame @@ -2358,7 +2385,7 @@ D\space##1% \expandafter\get@Label\psk@yLabels,\@nil } \def\get@Label#1,#2\@nil{% - \ifnum\the\pst@cnto=\the\pst@cntp + \ifnum\the\pst@cnto=\the\pst@cntp\relax #1 \else\global\advance\pst@cnto by \@ne \expandafter\get@Label#2,\@nil -- cgit v1.2.3