diff options
author | Karl Berry <karl@freefriends.org> | 2010-09-09 18:19:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-09-09 18:19:12 +0000 |
commit | 2ca61ccbc381d0879b2a7873b95e0d2b972a5bd7 (patch) | |
tree | 987103d14b34fe76b92b4a2d2ca1ff15235ece71 /Master | |
parent | ca6174f9c4fd4c9f7f8e849d208934db0fcb3fa8 (diff) |
pst-plot 1.18 (16aug10)
git-svn-id: svn://tug.org/texlive/trunk@19629 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/Changes | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/more_docs/README | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.bib | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf | bin | 772306 -> 781008 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex | 69 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex | 89 |
6 files changed, 164 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-plot/Changes b/Master/texmf-dist/doc/generic/pst-plot/Changes index adbbec4cd19..b0acd0c8652 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/Changes +++ b/Master/texmf-dist/doc/generic/pst-plot/Changes @@ -1,4 +1,10 @@ ----- pst-plot.tex +1.19 2010-08-17 - \def\psk@method{} + to fix a problem with \psplot +1.18 2010-08-15 - added plotstyle ybar + - added optional arguments xLabels, yLabels, + xLabelsRot, and yLabelsRot + - added plotstyle xvalues 1.17 2010-06-22 - fix bug with global setting of arguments in \readdata 1.16 2010-05-14 - allow origin when x axis is not crossing the y axis 1.15 2010-04-29 - fixed bug with double definition of tickstyle diff --git a/Master/texmf-dist/doc/generic/pst-plot/more_docs/README b/Master/texmf-dist/doc/generic/pst-plot/more_docs/README new file mode 100644 index 00000000000..efdfe42fcfd --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-plot/more_docs/README @@ -0,0 +1,3 @@ +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/pst-plot-doc.bib b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.bib index ba07f2211ce..64157b2710e 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.bib +++ b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.bib @@ -58,3 +58,12 @@ address = {Heidelberg/Hamburg} } +@Book{PSTricksE, + author = {Herbert Vo\ss{}}, + title = {\texttt{PSTricks} -- {G}raphics and {P}ost{S}cript for \LaTeX}, + edition = {1st}, + publisher = {UIT}, + year = {2010}, + address = {Cambridge -- UK} +} + 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 Binary files differindex 05e490795bc..e62656fbe01 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf 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 1bf58798d87..a82d58c6601 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 @@ -1,4 +1,4 @@ -%% $Id: pst-plot-doc.tex 314 2010-05-14 17:02:16Z herbert $ +%% $Id: pst-plot-doc.tex 369 2010-08-15 08:07:42Z herbert $ \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings headexclude,footexclude,oneside,dvipsnames,svgnames]{pst-doc} \listfiles @@ -474,6 +474,7 @@ An example with ticks on every side of the frame and filled areas: \end{lstlisting} + %------------------------------------------------------------------------------------------- \subsection{The new options for nxLenv{psgraph}}\label{psgraphoptions} %------------------------------------------------------------------------------------------- @@ -679,6 +680,7 @@ redefinition, then do it for \Lcs{pst@@@hlabel} and \Lkeyword{xAxisLabelPos} & (x,y) or empty & \{\Lcs{@empty}\} & \pageref{psgraphoptions}\\ \Lkeyword{xDecimals} & integer or empty & \{\} & \pageref{xydecimals}\\%ok \Lkeyword{xEnd} & integer or empty & \{\} & \pageref{nxend}\\ +\Lkeyword{xLabels} & list & \{\Lcs{empty}\} & \pageref{xLabels}\\ \Lkeyword{xlabelFactor} & anything & \{\Lcs{@empty}\} & \pageref{labelfactor}\\ \Lkeyword{xlabelPos} & \Lkeyval{bottom},\Lkeyval{axis},\Lkeyval{top} & \Lkeyval{bottom} & \pageref{labelpos}\\ @@ -703,7 +705,8 @@ redefinition, then do it for \Lcs{pst@@@hlabel} and \Lkeyword{yAxisLabelPos} & (x,y) or empty & \{\Lcs{@empty}\} & \pageref{psgraphoptions}\\ \Lkeyword{yDecimals} & integer or empty & \{\} & \pageref{xydecimals}\\%ok \Lkeyword{yEnd} & integer or empty & \{\} & \pageref{ystartend}\\ -\Lkeyword{ylabelFactor} & literal & \{\Lcs{@empty}\} & \pageref{labelfactor}\\ +\Lkeyword{yLabels} & list & \{\Lcs{empty}\} & \pageref{xLabels}\\ +\Lkeyword{ylabelFactor} & literal & \{\Lcs{empty}\} & \pageref{labelfactor}\\ \Lkeyword{ylabelPos} & \Lkeyval{left}|\Lkeyval{axis}|\Lkeyval{right} & \Lkeyval{left} & \pageref{labelpos}\\ \Lkeyword{ylogBase} & integer or empty & \{\} & \pageref{ylogbase}\\ @@ -724,6 +727,19 @@ redefinition, then do it for \Lcs{pst@@@hlabel} and } +%------------------------------------------------------------------------------------------- +\subsection{Option \nxLkeyword{xLabels}, \nxLkeyword{yLabels}, + \nxLkeyword{xLabelrot}, and \nxLkeyword{yLabelrot}}\label{xLabels} +%------------------------------------------------------------------------------------------- +\xLkeyword{xLabels}\xLkeyword{yLabels}\xLkeyword{xLabelRot}\xLkeyword{yLabelRot} +\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) +\end{pspicture} +\end{LTXexample} + %------------------------------------------------------------------------------------ \subsection{Option \nxLkeyword{yMaxValue}}\label{yMaxValue} @@ -2430,7 +2446,36 @@ total width. \end{pspicture} \end{LTXexample} -\clearpage +%-------------------------------------------------------------------------------------- +\subsection{Plot style \nxLkeyword{ybar}}\label{options:ybar} +%-------------------------------------------------------------------------------------- +With the setting \Lkeyset{plotstyle=ybar} the graph is set with horizontal bars instead +of vertical. For \Lkeyword{yLabels} see section~\ref{yLabels}. +. +\begin{center} +\savedata{\data}[1 1 1 2 1 3 2 4 3 5 4 6 4 7 6 8 6 9 7 10 25 11 30 12 32 13] + +\psset{llx=-1.5cm,lly=-1.5cm,xAxisLabel=\textbf{Frequency of Winning the Final}, + xAxisLabelPos={c,-1cm},yAxisLabel=,yLabels={,Kerry,Laois,London,Waterford,Clare,Offaly, + Galway,Wexford,Dublin,Limerick,Tipperary,Cork,Kilkenny}} +\begin{psgraph}[axesstyle=frame,labels=x,ticksize=-4pt 0,Dx=5](0,0)(35,14){10cm}{7cm} + \listplot[plotstyle=ybar,fillcolor=blue!20,linecolor=blue,barwidth=4mm,fillstyle=solid]{\data} + \listplot[plotstyle=xvalues,labelsep=5pt]{\data} +\end{psgraph} +\end{center} + +\begin{lstlisting} +\savedata{\data}[1 1 1 2 1 3 2 4 3 5 4 6 4 7 6 8 6 9 7 10 25 11 30 12 32 13] + +\psset{llx=-1.5cm,lly=-1.5cm,xAxisLabel=\textbf{Frequency of Winning the Final}, + xAxisLabelPos={c,-1cm},yAxisLabel=,yLabels={,Kerry,Laois,London,Waterford,Clare,Offaly, + Galway,Wexford,Dublin,Limerick,Tipperary,Cork,Kilkenny}} +\begin{psgraph}[axesstyle=frame,labels=x,ticksize=-4pt 0,Dx=5](0,0)(35,14){10cm}{7cm} + \listplot[plotstyle=ybar,fillcolor=blue!20,linecolor=blue,barwidth=4mm,fillstyle=solid]{\data} + \listplot[plotstyle=xvalues,labelsep=5pt]{\data} +\end{psgraph} +\end{lstlisting} + %-------------------------------------------------------------------------------------- \subsection{Plotstyle \nxLkeyval{LSM}}\label{LSM} %-------------------------------------------------------------------------------------- @@ -2576,6 +2621,24 @@ everything behind this box is not seen. \end{pspicture} \end{LTXexample} + +\subsection{Plotstyles \nxLkeyval{xvalues} and \nxLkeyval{xvalues*}}\label{xvalues} +This is similiar to the options \Lkeyval{values}, except that it plots the $x$-values +instead of the $y$-values. This maybe useful when also using the plotstyle \Lkeyval{ybar} +(see~Section\vref{options:ybar}). + +\medskip +\begin{LTXexample}[width=7cm] +\begin{pspicture}(-2.5,-.5)(2.5,5.5) + \psaxes{->}(0,0)(-2,0)(2,5.5) + \psplot{-2}{2}{x dup mul } + \psplot[plotstyle=xvalues, + plotpoints=10]{-2}{2}{x dup mul } +\end{pspicture} +\end{LTXexample} + + + \clearpage %-------------------------------------------------------------------------------------- \section{Polar plots}\label{polarplots} 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{% } % |