summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-2dplot
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-03-21 00:09:18 +0000
committerKarl Berry <karl@freefriends.org>2007-03-21 00:09:18 +0000
commitf17c03aa1e3f4e0b175b3d0b75435c2f92f0876d (patch)
tree8a717550534a4fcbefc9da2e3e8fde0c9ee14f2a /Master/texmf-dist/tex/latex/pst-2dplot
parentdf757cca4c2688316b21433f462995397099cb5b (diff)
new package pst-2dplot (24jan07)
git-svn-id: svn://tug.org/texlive/trunk@4069 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-2dplot')
-rw-r--r--Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty153
1 files changed, 153 insertions, 0 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
new file mode 100644
index 00000000000..021412bbc57
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pst-2dplot/pst-2dplot.sty
@@ -0,0 +1,153 @@
+%%=========================================
+%% This is file 'pst-2dplot.sty'
+%% 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
+%%=========================================
+
+\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)
+
+ \pst@divide{\@pstaxes@xbox pt}{2pt}\@pstaxes@pos
+ \rput[t](\@pstaxes@pos,-\@pstaxes@xlabelsep){\@pstaxes@xlabel}
+
+ \pst@divide{\@pstaxes@ybox pt}{2pt}\@pstaxes@pos
+ \rput[b]{90}(-\@pstaxes@ylabelsep,\@pstaxes@pos){\@pstaxes@ylabel}
+ \end{pspicture}
+}
+%-----------------------------------------------
+
+
+
+%-----------------------------------------------
+% Commands
+%-----------------------------------------------
+\newcommand{\pstaxessetup}[1]{\setkeys{pstaxes}{#1}}
+\newcommand{\pstxlabel}[1]{\setkeys{pstaxes}{xlabel=#1}}
+\newcommand{\pstylabel}[1]{\setkeys{pstaxes}{ylabel=#1}}
+%-----------------------------------------------