summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorDr. Clea F. Rees <cfrees@imapmail.org>2008-12-29 00:05:36 +0000
committerDr. Clea F. Rees <cfrees@imapmail.org>2008-12-29 00:05:36 +0000
commitb999f45638630285cefbe6309f20be72805c190e (patch)
treefb70bcdfcd07a62d90b80cace16144dae12d1c90 /Master/texmf-dist/tex/latex
parentf8b8a4efd187e111ef8551dce9da148a524ed01c (diff)
pst-2dplot update 2008/12/29
git-svn-id: svn://tug.org/texlive/trunk@11746 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty278
1 files changed, 137 insertions, 141 deletions
diff --git a/Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty b/Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty
index 021412bbc57..5eb24fd5e0c 100644
--- a/Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty
+++ b/Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty
@@ -3,151 +3,147 @@
%% It provides the pst-2dplot package.
%% ------------------------------------
%% Author: Farshid Delgosha
-%% 326004 Georgia Tech Station
-%% Atlanta, GA 30332-1085
-%% U.S.A.
-%% E-mail: delgosha@ieee.org
+%% E-mail: fdelgosha@gmail.com
%%=========================================
-\ProvidesPackage{pst-2dplot}[2006/08/20 Version 1.0 by Farshid Delgosha]
-\NeedsTeXFormat{LaTeX2e}[1994/06/01]
-\typeout{%
-*****************************************************^^J%
-Package `pst-2dplot' (Version 1.0) -- 22 January 2007 --^^J%
-Author: Farshid Delgosha (delgosha@ieee.org)^^J%
-*****************************************************}
-
-\def\fileversion{1.0}
-\def\filedate{2007/01/22}
-
-\csname PSTtwoDPlotLoaded\endcsname
-\let\PSTtwoDPlotLoaded\endinput
-
-
-
-\RequirePackage{xkeyval,calc}
-\RequirePackage{pstricks-add}
-
-
-
-%-----------------------------------------------
-% PSTAXES local variables
-%-----------------------------------------------
-\def\@pstaxes@xmin{0}
-\def\@pstaxes@ymin{0}
-\def\@pstaxes@xmax{1}
-\def\@pstaxes@ymax{1}
-\def\@pstaxes@xbox{1}
-\def\@pstaxes@ybox{1}
-\def\@pstaxes@gridwidth{.5pt}
-\def\@pstaxes@gridcolor{gray}
-\def\@pstaxes@gridstyle{solid}
-\def\@pstaxes@xgriddiv{1}
-\def\@pstaxes@ygriddiv{1}
-\def\@pstaxes@xticksize{.1}
-\def\@pstaxes@yticksize{.1}
-\def\@pstaxes@xlabel{}
-\def\@pstaxes@ylabel{}
-\def\@pstaxes@xtagsep{.4}
-\def\@pstaxes@ytagsep{.5}
-\def\@pstaxes@xlabelsep{.8}
-\def\@pstaxes@ylabelsep{1}
-%-----------------------------------------------
-
-
-%-----------------------------------------------
-% assign PSTAXES local variables
-%-----------------------------------------------
-\define@key{pstaxes}{xmin}{\renewcommand\@pstaxes@xmin{#1}}
-\define@key{pstaxes}{ymin}{\renewcommand\@pstaxes@ymin{#1}}
-\define@key{pstaxes}{xmax}{\renewcommand\@pstaxes@xmax{#1}}
-\define@key{pstaxes}{ymax}{\renewcommand\@pstaxes@ymax{#1}}
-\define@key{pstaxes}{xbox}{\renewcommand\@pstaxes@xbox{#1}}
-\define@key{pstaxes}{ybox}{\renewcommand\@pstaxes@ybox{#1}}
-\define@key{pstaxes}{gridwidth}{\renewcommand\@pstaxes@gridwidth{#1}}
-\define@key{pstaxes}{gridcolor}{\renewcommand\@pstaxes@gridcolor{#1}}
-\define@key{pstaxes}{gridstyle}{\renewcommand\@pstaxes@gridstyle{#1}}
-\define@key{pstaxes}{xgriddiv}{\renewcommand\@pstaxes@xgriddiv{#1}}
-\define@key{pstaxes}{ygriddiv}{\renewcommand\@pstaxes@ygriddiv{#1}}
-\define@key{pstaxes}{xticksize}{\renewcommand\@pstaxes@xticksize{#1}}
-\define@key{pstaxes}{yticksize}{\renewcommand\@pstaxes@yticksize{#1}}
-\define@key{pstaxes}{xlabel}{\renewcommand\@pstaxes@xlabel{#1}}
-\define@key{pstaxes}{ylabel}{\renewcommand\@pstaxes@ylabel{#1}}
-\define@key{pstaxes}{xlabelsep}{\renewcommand\@pstaxes@xlabelsep{#1}}
-\define@key{pstaxes}{ylabelsep}{\renewcommand\@pstaxes@ylabelsep{#1}}
-\define@key{pstaxes}{xtagsep}{\renewcommand\@pstaxes@xtagsep{#1}}
-\define@key{pstaxes}{ytagsep}{\renewcommand\@pstaxes@ytagsep{#1}}
-%-----------------------------------------------
-
-
-
-%-----------------------------------------------
-% PSTAXES internal variables
-%-----------------------------------------------
-\newcounter{@pstaxes@grid}
-\def\@pstaxes@dx{1}
-\def\@pstaxes@dy{1}
-\def\@pstaxes@Dx{1}
-\def\@pstaxes@Dy{1}
-\def\@pstaxes@pos{1}
-\newlength{\@pstaxes@xrange}
-\newlength{\@pstaxes@yrange}
-\newlength{\@pstaxes@XunitTemp}
-\newlength{\@pstaxes@YunitTemp}
-%-----------------------------------------------
-
-
-
-%-----------------------------------------------
-% PSTAXES environment
-%-----------------------------------------------
-\newenvironment{pstaxes}[1][]{
- \setkeys{pstaxes}{#1}
- \begin{pspicture}(-\@pstaxes@xtagsep,-\@pstaxes@ytagsep)(\@pstaxes@xbox,\@pstaxes@ybox)
- \setlength{\@pstaxes@xrange}{\@pstaxes@xmax pt - \@pstaxes@xmin pt}
- \setlength{\@pstaxes@yrange}{\@pstaxes@ymax pt - \@pstaxes@ymin pt}
-
- \setcounter{@pstaxes@grid}{\@pstaxes@xgriddiv}
- \addtocounter{@pstaxes@grid}{1}
- \pst@divide{\@pstaxes@xbox pt}{\@pstaxes@xgriddiv pt}\@pstaxes@dx
- \pst@divide{\@pstaxes@xrange}{\@pstaxes@xgriddiv pt}\@pstaxes@Dx
- \multido{\rx=0+\@pstaxes@dx,\rX=\@pstaxes@xmin+\@pstaxes@Dx}{\the@pstaxes@grid}%
- {\psline[linecolor=\@pstaxes@gridcolor,linewidth=\@pstaxes@gridwidth,linestyle=\@pstaxes@gridstyle]
- (\rx,-\@pstaxes@xticksize)(\rx,\@pstaxes@ybox)
- \rput[t](\rx,-\@pstaxes@xtagsep){$\rX$}}
-
- \setcounter{@pstaxes@grid}{\@pstaxes@ygriddiv}
- \addtocounter{@pstaxes@grid}{1}
- \pst@divide{\@pstaxes@ybox pt}{\@pstaxes@ygriddiv pt}\@pstaxes@dy
- \pst@divide{\@pstaxes@yrange}{\@pstaxes@ygriddiv pt}\@pstaxes@Dy
- \multido{\ry=0+\@pstaxes@dy,\rY=\@pstaxes@ymin+\@pstaxes@Dy}{\the@pstaxes@grid}%
- {\psline[linecolor=\@pstaxes@gridcolor,linewidth=\@pstaxes@gridwidth,linestyle=\@pstaxes@gridstyle]
- (-\@pstaxes@yticksize,\ry)(\@pstaxes@xbox,\ry)
- \rput[r](-\@pstaxes@ytagsep,\ry){$\rY$}}
-
- \setlength{\@pstaxes@XunitTemp}{\psxunit}
- \setlength{\@pstaxes@YunitTemp}{\psyunit}
- \psset{xunit=\@pstaxes@xbox,yunit=\@pstaxes@ybox}
-}
-{
- \psset{xunit=\@pstaxes@XunitTemp,yunit=\@pstaxes@YunitTemp}
- \psframe[linecolor=black,linestyle=solid](\@pstaxes@xbox,\@pstaxes@ybox)
+\ProvidesPackage{pst-2dplot}[2008/12/26 by Farshid Delgosha]
- \pst@divide{\@pstaxes@xbox pt}{2pt}\@pstaxes@pos
- \rput[t](\@pstaxes@pos,-\@pstaxes@xlabelsep){\@pstaxes@xlabel}
+\csname PSTiidpLoaded\endcsname
+\def\fileversion{1.5}
+\def\filedate{2008/12/26}
+\message{`pst-2dplot' v\fileversion, \filedate\space (Farshid Delgosha)}
- \pst@divide{\@pstaxes@ybox pt}{2pt}\@pstaxes@pos
- \rput[b]{90}(-\@pstaxes@ylabelsep,\@pstaxes@pos){\@pstaxes@ylabel}
- \end{pspicture}
-}
-%-----------------------------------------------
+\ifx\PSTricksLoaded\endinput\else\input pstricks \fi
+\ifx\PSTplotLoaded\endinput\else \input pst-plot \fi
+\ifx\MultidoLoaded\endinput\else \input multido \fi
+\ifx\XKeyValLoaded\endinput\else \input xkeyval \fi
+%\ifx\PSTricksAddLoaded\endinput\else \input pstricks-add \fi
-%-----------------------------------------------
-% Commands
-%-----------------------------------------------
-\newcommand{\pstaxessetup}[1]{\setkeys{pstaxes}{#1}}
-\newcommand{\pstxlabel}[1]{\setkeys{pstaxes}{xlabel=#1}}
-\newcommand{\pstylabel}[1]{\setkeys{pstaxes}{ylabel=#1}}
-%-----------------------------------------------
+%--- internal macros -------------------------------------
+\newdimen\iidp@SubDiv@dimenA
+\newdimen\iidp@SubDiv@dimenB
+%
+\def\pst@SubDiv#1#2#3#4#5{%
+\pssetlength{\iidp@SubDiv@dimenA}{#1 pt}%
+\psaddtolength{\iidp@SubDiv@dimenA}{-#2 pt}%
+\pssetlength{\iidp@SubDiv@dimenB}{#3 pt}%
+\psaddtolength{\iidp@SubDiv@dimenB}{-#4 pt}%
+\pst@divide{\iidp@SubDiv@dimenA}{\iidp@SubDiv@dimenB}#5%
+}
+%--- end internal macros ---------------------------------
+
+
+
+%--- keys ------------------------------------------------
+\define@key{pstgraph}{xmin}{\def\iidp@graph@xmin{#1}}
+\define@key{pstgraph}{xmax}{\def\iidp@graph@xmax{#1}}
+\define@key{pstgraph}{ymin}{\def\iidp@graph@ymin{#1}}
+\define@key{pstgraph}{ymax}{\def\iidp@graph@ymax{#1}}
+\define@key{pstgraph}{xgriddiv}{\def\iidp@graph@xgriddiv{#1}}
+\define@key{pstgraph}{ygriddiv}{\def\iidp@graph@ygriddiv{#1}}
+\define@key{pstgraph}{gridstyle}{\def\iidp@graph@gridstyle{#1}}
+\define@key{pstgraph}{gridcolor}{\def\iidp@graph@gridcolor{#1}}
+\define@key{pstgraph}{gridwidth}{\def\iidp@graph@gridwidth{#1}}
+\define@key{pstgraph}{xticksize}{\def\iidp@graph@xticksize{#1}}
+\define@key{pstgraph}{yticksize}{\def\iidp@graph@yticksize{#1}}
+\define@key{pstgraph}{xtagsep}{\def\iidp@graph@xtagsep{#1}}
+\define@key{pstgraph}{ytagsep}{\def\iidp@graph@ytagsep{#1}}
+\define@key{pstgraph}{xtagformat}{\def\iidp@graph@xtagformat{#1}}
+\define@key{pstgraph}{ytagformat}{\def\iidp@graph@ytagformat{#1}}
+\define@key{pstgraph}{xlabel}{\def\iidp@graph@xlabel{#1}}
+\define@key{pstgraph}{ylabel}{\def\iidp@graph@ylabel{#1}}
+\define@key{pstgraph}{xlabelsep}{\def\iidp@graph@xlabelsep{#1}}
+\define@key{pstgraph}{ylabelsep}{\def\iidp@graph@ylabelsep{#1}}
+\define@key{pstgraph}{framewidth}{\def\iidp@graph@framewidth{#1}}
+\define@key{pstgraph}{framecolor}{\def\iidp@graph@framecolor{#1}}
+%--- end keys --------------------------------------------
+
+
+%--- initial key values ----------------------------------
+\setkeys{pstgraph}{%
+xmin=0,xmax=1,ymin=0,ymax=1,%
+xgriddiv=1,ygriddiv=1,gridstyle=solid,gridcolor=gray,gridwidth=.5pt,%
+xticksize=.1,yticksize=.1,xtagsep=.2,ytagsep=.2,xtagformat=\scriptstyle,ytagformat=\scriptstyle,%
+xlabel={},ylabel={},xlabelsep=.55,ylabelsep=.75,framewidth=1pt,framecolor=black%
+}
+%--- end initial key values ------------------------------
+
+
+%--- pstgraph --------------------------------------------
+\def\iidp@graph@gridDx{}
+\def\iidp@graph@gridDy{}
+\newcount\iidp@graph@grid
+\def\iidp@graph@Dx{}
+\def\iidp@graph@Dy{}
+\newdimen\iidp@graph@pstgraph@dimen
+\def\iidp@graph@xscale{}
+\def\iidp@graph@yscale{}
+%%-------------------------------
+\def\pstgraph{\@ifnextchar[{\pst@graph}{\pst@graph[]}}
+\def\pst@graph[#1](#2,#3){%
+\setkeys{pstgraph}{#1}%
+\pspicture(-\iidp@graph@xlabelsep,-\iidp@graph@ylabelsep)(#2,#3)%
+\def\iidp@graph@xframe{#2}
+\def\iidp@graph@yframe{#3}
+%
+\newpsstyle{grid@style}{linestyle=\iidp@graph@gridstyle,linecolor=\iidp@graph@gridcolor,linewidth=\iidp@graph@gridwidth}
+%
+\pst@divide{\iidp@graph@xframe pt}{\iidp@graph@xgriddiv pt}\iidp@graph@gridDx
+\iidp@graph@grid=\iidp@graph@xgriddiv\relax
+\advance\iidp@graph@grid\@ne
+\pst@SubDiv{\iidp@graph@xmax}{\iidp@graph@xmin}{\iidp@graph@xgriddiv}{0}\iidp@graph@Dx
+\multido{\rx=0+\iidp@graph@gridDx,\rlab=\iidp@graph@xmin+\iidp@graph@Dx}{\the\iidp@graph@grid}{%
+\rput(\rx,0){\psline[style=grid@style](0,-\iidp@graph@xticksize)(0,#3)}%
+\rput[t](\rx,-\iidp@graph@xtagsep){$\iidp@graph@xtagformat\rlab$}%
+}
+%
+\pst@divide{\iidp@graph@yframe pt}{\iidp@graph@ygriddiv pt}\iidp@graph@gridDy
+\iidp@graph@grid=\iidp@graph@ygriddiv\relax
+\advance\iidp@graph@grid\@ne
+\pst@SubDiv{\iidp@graph@ymax}{\iidp@graph@ymin}{\iidp@graph@ygriddiv}{0}\iidp@graph@Dy
+\multido{\ry=0+\iidp@graph@gridDy,\rlab=\iidp@graph@ymin+\iidp@graph@Dy}{\the\iidp@graph@grid}{%
+\rput(0,\ry){\psline[style=grid@style](-\iidp@graph@yticksize,0)(#2,0)}%
+\rput[r](-\iidp@graph@ytagsep,\ry){$\iidp@graph@ytagformat\rlab$}%
+}
+%
+\pst@SubDiv{\iidp@graph@xframe}{0}{\iidp@graph@xmax}{\iidp@graph@xmin}\iidp@graph@xscale
+\pst@SubDiv{\iidp@graph@yframe}{0}{\iidp@graph@ymax}{\iidp@graph@ymin}\iidp@graph@yscale
+}
+%%-------------------------------
+\def\endpstgraph{%
+\psframe[framearc=0,linewidth=\iidp@graph@framewidth,linecolor=\iidp@graph@framecolor,linestyle=solid,dimen=middle]%
+(0,0)(\iidp@graph@xframe,\iidp@graph@yframe)%
+%
+\pssetlength{\iidp@graph@pstgraph@dimen}{\iidp@graph@xframe}%
+\pssetlength{\iidp@graph@pstgraph@dimen}{.5\iidp@graph@pstgraph@dimen}%
+\rput[t](\iidp@graph@pstgraph@dimen,-\iidp@graph@xlabelsep){\iidp@graph@xlabel}%
+%
+\pssetlength{\iidp@graph@pstgraph@dimen}{\iidp@graph@yframe}%
+\pssetlength{\iidp@graph@pstgraph@dimen}{.5\iidp@graph@pstgraph@dimen}%
+\rput[b]{90}(-\iidp@graph@ylabelsep,\iidp@graph@pstgraph@dimen){\iidp@graph@ylabel}%
+\endpspicture}
+%--- end pstgraph ----------------------------------------
+
+
+%--- setpstgraph -----------------------------------------
+\def\setpstgraph#1{\setkeys{pstgraph}{#1}}
+%--- end setpstgraph -------------------------------------
+
+
+%--- pstlabel --------------------------------------------
+\def\pstlabel#1#2{\setkeys{pstgraph}{xlabel=#1,ylabel=#2}}
+%--- end pstlabel ----------------------------------------
+
+
+%--- pstfileplot -----------------------------------------
+\def\pstfileplot{\@ifnextchar[{\pst@fileplot}{\pst@fileplot[]}}
+\def\pst@fileplot[#1]#2{%
+\ifx\empty#1\empty%
+\fileplot[xunit=\iidp@graph@xscale,yunit=\iidp@graph@yscale]{#2}%
+\else%
+\fileplot[xunit=\iidp@graph@xscale,yunit=\iidp@graph@yscale,#1]{#2}%
+\fi%
+}
+%--- end pstfileplot ------------------------------------- \ No newline at end of file