summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-09 18:19:12 +0000
committerKarl Berry <karl@freefriends.org>2010-09-09 18:19:12 +0000
commit2ca61ccbc381d0879b2a7873b95e0d2b972a5bd7 (patch)
tree987103d14b34fe76b92b4a2d2ca1ff15235ece71 /Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex
parentca6174f9c4fd4c9f7f8e849d208934db0fcb3fa8 (diff)
pst-plot 1.18 (16aug10)
git-svn-id: svn://tug.org/texlive/trunk@19629 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex89
1 files changed, 80 insertions, 9 deletions
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 61e221f3b11..b400ec043cc 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 356 2010-06-22 13:43:55Z herbert $
+% $Id: pst-plot.tex 371 2010-08-17 09:28:58Z 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.17}
-\def\filedate{2010/06/22}
+\def\fileversion{1.19}
+\def\filedate{2010/08/17}
\message{ v\fileversion, \filedate\space (tvz,hv)}
%
\edef\TheAtCode{\the\catcode`\@}
@@ -30,6 +30,7 @@
\pst@addfams{pst-plot}
%
\def\pst@linetype{2}%
+\def\psk@method{}% is defined as option in pstricks-add
\SpecialCoor
%
\def\psPiFour{12.566371}
@@ -227,6 +228,22 @@ D\space##1%
\pst@stroke
\end@SpecialObj}
%
+\def\psybar@ii{\addto@pscode{false \tx@NArray \psybar@iii}}
+\def\psybar@iii{%
+ newpath
+ n {
+ /Yval exch def /Xval exch def
+ 0 Yval \number\Add@barwidth 0.5 mul sub moveto
+ Xval 0 rlineto 0 \number\Add@barwidth rlineto
+ Xval neg 0 rlineto 0 \number\Add@barwidth neg rlineto
+ } repeat
+}%
+\def\beginplot@ybar{\begin@SpecialObj}
+\def\endplot@ybar{%
+ \psybar@ii\psk@fillstyle\ifpsshadow\pst@closedshadow\fi%
+ \pst@stroke
+ \end@SpecialObj}
+%
% LSM Least Square Method 2006-03-13 (hv)
\def\psLSM@ii{\addto@pscode{ false \tx@NArray \psLSM@iii }}
\def\psLSM@iii{%
@@ -505,35 +522,54 @@ D\space##1%
\psset[pst-plot]{PSfont=Times-Roman,fontscale=10,valuewidth=10,decimals=-1}
%
\newif\ifPst@valuesStar\Pst@valuesStarfalse
+\newif\ifPst@xvalues\Pst@xvaluesfalse
+%
\def\psvalues@ii{\addto@pscode{ false \tx@NArray \psvalues@iii }}
\def\psvalues@iii{
\psk@PSfont findfont \psk@fontscale scalefont setfont
newpath
n { /yO ED /xO ED
gsave
- yO \pst@number\psyunit div
+ \ifPst@xvalues
+ xO \pst@number\psxunit div
+ \else
+ yO \pst@number\psyunit div
+ \fi
\psk@decimals 0 eq { cvi } if
\psk@decimals 0 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if
\psk@valuewidth string cvs /Str ED
\ifPst@valuesStar
Str stringwidth pop /yS \psk@fontscale def /xS ED
gsave newpath
- xO yO \pst@number\pslabelsep add moveto \ifx\psk@rot\@empty\else\psk@rot rotate \fi
+ xO \ifPst@xvalues \pst@number\pslabelsep add \fi
+ yO \ifPst@xvalues\else \pst@number\pslabelsep add \fi
+ moveto \ifx\psk@rot\@empty\else\psk@rot rotate \fi
xS 0 rlineto 0 yS rlineto xS neg 0 rlineto 0 yS neg rlineto
closepath 1 setgray fill stroke
grestore
\fi
- xO yO \pst@number\pslabelsep add moveto \ifx\psk@rot\@empty\else\psk@rot rotate \fi
+ xO \ifPst@xvalues \pst@number\pslabelsep add \fi
+ yO \ifPst@xvalues\else \pst@number\pslabelsep add \fi
+ moveto \ifx\psk@rot\@empty\else\psk@rot rotate \fi
Str show
grestore } repeat
}%
\def\beginplot@values{\Pst@valuesStarfalse\begin@SpecialObj}
\expandafter\def\csname beginplot@values*\endcsname{\Pst@valuesStartrue\begin@SpecialObj}
+\def\beginplot@xvalues{\Pst@valuesStarfalse\begin@SpecialObj}
+\expandafter\def\csname beginplot@xvalues*\endcsname{\Pst@valuesStartrue\begin@SpecialObj}
\def\endplot@values{%
+ \Pst@xvaluesfalse%
\psvalues@ii%
\pst@stroke
\end@SpecialObj}
\@namedef{endplot@values*}{\endplot@values}
+\def\endplot@xvalues{%
+ \Pst@xvaluestrue%
+ \psvalues@ii%
+ \pst@stroke
+ \end@SpecialObj}
+\@namedef{endplot@xvalues*}{\endplot@xvalues}
%
% end (hv) --------------------------------------------------------------
%
@@ -1869,9 +1905,16 @@ D\space##1%
{\@pstrickserr{Axes style `#1' not defined}\@eha}%
{\def\psk@axesstyle{#1}}}
\psset[pst-plot]{axesstyle=axes}
+\define@key[psset]{pst-plot}{xLabels}[]{\def\psk@xLabels{#1}}
+\define@key[psset]{pst-plot}{xLabelsRot}[0]{\pst@getangle{#1}\pst@xLabelsRot}
+\psset[pst-plot]{xLabels=,xLabelsRot=0}
+\define@key[psset]{pst-plot}{yLabels}[]{\def\psk@yLabels{#1}}
+\define@key[psset]{pst-plot}{yLabelsRot}[0]{\pst@getangle{#1}\pst@yLabelsRot}
+\psset[pst-plot]{yLabels=,yLabelsRot=0}
%
% #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max
\def\pst@hlabels#1#2#3#4{%
+ \ifx\empty\psk@xLabels
\kern\psk@xlabelOffset pt % set the x offset?
\ifdim#1=\z@\else% % start from 0 ?
\ifx#2\empty\else\advance#1\ifdim#1>\z@-\fi7\pslinewidth\fi%
@@ -1884,6 +1927,11 @@ D\space##1%
\showoriginfalse%
\fi%
\fi%
+ \else
+ \pst@cnta=#1\relax% % Distance (in sp) to end.
+ \divide\pst@cnta\psk@dx\relax% % Number of ticks/labels
+ \multido{\nA=#3+1}{\pst@cnta}{\uput{\pslabelsep}[-90]{\pst@xLabelsRot}(\nA,\pslabelsep){\psPutXLabel{\nA}}}%
+ \fi%
}
% Knows \pst@dimb and \pst@cnta
\def\pst@@hlabels{%
@@ -1910,7 +1958,8 @@ D\space##1%
% #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max
% \psk@labels 0:all; 1:x; 2:y; 3:none
\def\pst@vlabels#1#2#3#4{%
- \ifdim#1=\z@\else%
+ \ifx\empty\psk@yLabels
+ \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
@@ -1920,6 +1969,11 @@ D\space##1%
\showoriginfalse%
\fi%
\fi%
+ \else%
+ \pst@cnta=#1\relax% % % Distance (in sp) to end.
+ \divide\pst@cnta\psk@dy\relax% % Number of ticks/labels
+ \multido{\nA=#3+1}{\the\pst@cnta}{\uput{\pslabelsep}[180]{\pst@yLabelsRot}(\pslabelsep,\nA){\psPutYLabel{\nA}}}%
+ \fi%
}
% \pst@dima: the width between two labels in pt
% \pst@dimc: the coordinate of the origin in pt
@@ -1954,8 +2008,8 @@ D\space##1%
}\vss}%
}
%
-\define@key[psset]{pst-plot}{xAxisLabel}{\def\psk@xAxisLabel{#1}}
-\define@key[psset]{pst-plot}{yAxisLabel}{\def\psk@yAxisLabel{#1}}
+\define@key[psset]{pst-plot}{xAxisLabel}[x]{\def\psk@xAxisLabel{#1}}
+\define@key[psset]{pst-plot}{yAxisLabel}[y]{\def\psk@yAxisLabel{#1}}
\psset[pst-plot]{xAxisLabel=x,yAxisLabel=y}
\define@key[psset]{pst-plot}{xAxisLabelPos}[{}]{\def\psk@xAxisLabelPos{#1}}
\define@key[psset]{pst-plot}{yAxisLabelPos}[{}]{\def\psk@yAxisLabelPos{#1}}
@@ -2085,6 +2139,23 @@ D\space##1%
\@namedef{psgraph*}{\psgraph*}
\@namedef{endpsgraph*}{\endpsgraph}
%
+\def\psPutXLabel#1{%
+ \global\pst@cntm=0\relax
+ \global\pst@cntn=#1\relax
+ \expandafter\get@Label\psk@xLabels,\@nil
+}
+\def\psPutYLabel#1{%
+ \global\pst@cntm=0\relax
+ \global\pst@cntn=#1\relax
+ \expandafter\get@Label\psk@yLabels,\@nil
+}
+\def\get@Label#1,#2\@nil{%
+ \ifnum\the\pst@cntm=\the\pst@cntn
+ #1
+ \else\global\advance\pst@cntm by \@ne
+ \expandafter\get@Label#2,\@nil
+ \fi%
+}
\def\psResetPlotValues{%
}
%