summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/generic/pst-plot/Changes2
-rw-r--r--Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdfbin789673 -> 806762 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex123
-rw-r--r--Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex37
4 files changed, 157 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-plot/Changes b/Master/texmf-dist/doc/generic/pst-plot/Changes
index 7585f9682d9..2c6825bd726 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.25 2010-12-14 - added \pslegend and style legendstyle for the
+ psgraph environment
1.24 2010-11-14 - fix bug: replaced psk@ticks with psk@labels
1.23 2010-10-21 - add option plotNoX to choose any column as x value
1.22 2010-10-02 - fix bug with wrong color for the axes when using
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 af622328c49..abbafa04a13 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
Binary files 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 715e74c97c5..4fdbba4048b 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 401 2010-10-21 07:34:02Z herbert $
+%% $Id: pst-plot-doc.tex 432 2010-12-14 08:01:58Z herbert $
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings
headexclude,footexclude,oneside,dvipsnames,svgnames]{pst-doc}
\listfiles
@@ -473,10 +473,23 @@ An example with ticks on every side of the frame and filled areas:
\end{psgraph}
\end{lstlisting}
+\clearpage
+\subsection{Coordinates of the \nxLenv{psgraph} area}
+The coordinates of the calculated area are saved in the four macros \Lcs{psgraphLLx}, \Lcs{psgraphLLy}, \Lcs{psgraphURx}, and \Lcs{psgraphURy},
+which is LowerLeft, UpperLeft, LowerRight, and UpperRight. The values have no dimension but are saved in the current unit.
+\begin{LTXexample}[width=4cm]
+\psset{llx=-5mm,lly=-1cm}
+\begin{psgraph}[axesstyle=none,ticks=none](0,0)(3.0,9.0){4cm}{5cm}
+ \psdot[dotscale=2](\psgraphLLx,\psgraphLLy)
+ \psdot[dotscale=2](\psgraphLLx,\psgraphURy)
+ \psdot[dotscale=2](\psgraphURx,\psgraphLLy)
+ \psdot[dotscale=2](\psgraphURx,\psgraphURy)
+\end{psgraph}
+\end{LTXexample}
%-------------------------------------------------------------------------------------------
-\subsection{The new options for nxLenv{psgraph}}\label{psgraphoptions}
+\subsection{The new options for \nxLenv{psgraph}}\label{psgraphoptions}
%-------------------------------------------------------------------------------------------
\begin{center}
@@ -536,8 +549,114 @@ can be outside of the visible \Lenv{pspicture} environment.
}
\end{lstlisting}
+\subsection{The new macro \Lcs{pslegend} for \nxLenv{psgraph}}\label{pslegend}
+
+\begin{BDef}
+\Lcs{pslegend}\OptArg{Reference}\OptArg*{\Largr{xOffset,yOffset}}\Largb{Text}
+\end{BDef}
+
+The reference can be one of the \Lkeyval{lb}, \Lkeyval{lt}, \Lkeyval{rb}, or \Lkeyval{rt}, where the
+latter is the default. The values for \texttt{xOffset} and \texttt{yOffset} must be multiples of the unit pt.
+Without an offset the value of \Lcs{pslabelsep} are used.
+The legend has to be defined \emph{before} the environment \Lenv{psgraph}.
+
+\medskip
+\begin{center}
+\readdata{\data}{demo2.data}%
+\readdata{\dataII}{demo3.data}%
+\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
+ yAxisLabel=Whatever,xAxisLabelPos={c,-0.4in},%
+ yAxisLabelPos={-0.4in,c}}
+\pstScalePoints(1,1){1989 sub}{}
+\pslegend[lt]{\red\rule[1ex]{2em}{1pt} & Data I\\
+ \blue\rule[1ex]{2em}{1pt} & Data II\\
+ \cyan\rule[1ex]{2em}{1pt} & Data III}
+\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
+ \listplot[linecolor=red,linewidth=2pt]{\data}%
+ \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
+ \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
+\end{psgraph}%
+\end{center}
+
+
+\begin{lstlisting}
+\readdata{\data}{demo2.data}%
+\readdata{\dataII}{demo3.data}%
+\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
+ yAxisLabel=Whatever,xAxisLabelPos={c,-0.4in},%
+ yAxisLabelPos={-0.4in,c}}
+\pstScalePoints(1,1){1989 sub}{}
+\pslegend[lt]{\red\rule[1ex]{2em}{1pt} & Data I\\
+ \blue\rule[1ex]{2em}{1pt} & Data II\\
+ \cyan\rule[1ex]{2em}{1pt} & Data III}
+\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
+ \listplot[linecolor=red,linewidth=2pt]{\data}%
+ \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
+ \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
+\end{psgraph}%
+\end{lstlisting}
+
+\begin{compactitem}
+\item \Lcs{pslegend} uses the commands \Lcs{tabular} and \Lcs{endtabular}, which are only available
+ when running \LaTeX. With \TeX\ you have to redefine the macro \Lcs{pslegend@ii}:
+\begin{lstlisting}
+\def\pslegend@ii[#1](#2){\rput[#1](!#2){\psframebox[style=legendstyle]{%
+ \footnotesize\tabcolsep=2pt%
+ \tabular[t]{@{}ll@{}}\pslegend@text\endtabular}}\gdef\pslegend@text{}}
+\end{lstlisting}
+\item The fontsize can be changed locally for each cell or globally, when also redefining the
+ macro \Lcs{pslegend@ii}.
+\item If you want to use more than two columns for the table or a shadow box, then redefine \Lcs{pslegend@ii}.
+\end{compactitem}
+
+The macro \Lcs{psframebox} uses the style \Lkeyval{legendstyle} which is preset to \Lkeyset{fillstyle=solid},
+\Lkeyset{fillcolor=white}, and \nxLkeyword{linewidth=0.5pt} and can be redefined by
+
+\begin{lstlisting}
+\newpsstyle{legendstyle}{fillstyle=solid,fillcolor=red!20,shadow=true}
+\end{lstlisting}
+
+\medskip
+\begin{center}
+\readdata{\data}{demo2.data}%
+\readdata{\dataII}{demo3.data}%
+\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
+ yAxisLabel=Whatever,xAxisLabelPos={c,-0.4in},%
+ yAxisLabelPos={-0.4in,c}}
+\newpsstyle{legendstyle}{fillstyle=solid,fillcolor=red!20,shadow=true}
+\pstScalePoints(1,1){1989 sub}{}
+\pslegend[lt](10,10){\red\rule[1ex]{2em}{1pt} & Data I\\
+ \blue\rule[1ex]{2em}{1pt} & Data II\\
+ \cyan\rule[1ex]{2em}{1pt} & Data III}
+\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
+ \listplot[linecolor=red,linewidth=2pt]{\data}%
+ \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
+ \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
+\end{psgraph}%
+\end{center}
+
+
+\begin{lstlisting}
+\readdata{\data}{demo2.data}%
+\readdata{\dataII}{demo3.data}%
+\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
+ yAxisLabel=Whatever,xAxisLabelPos={c,-0.4in},%
+ yAxisLabelPos={-0.4in,c}}
+\pstScalePoints(1,1){1989 sub}{}
+\newpsstyle{legendstyle}{fillstyle=solid,fillcolor=red!20,shadow=true}
+\pslegend[lt](10,10){\red\rule[1ex]{2em}{1pt} & Data I\\
+ \blue\rule[1ex]{2em}{1pt} & Data II\\
+ \cyan\rule[1ex]{2em}{1pt} & Data III}
+\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
+ \listplot[linecolor=red,linewidth=2pt]{\data}%
+ \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
+ \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
+\end{psgraph}%
+\end{lstlisting}
+
+\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\nxLcs{psxTick} and \nxLcs{psyTick}}
Single ticks with labels on an axis can be set with the two
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 7352e28515b..e89b28864ed 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 419 2010-11-14 18:37:29Z herbert $
+% $Id: pst-plot.tex 428 2010-11-28 16:22: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.24}
-\def\filedate{2010/11/14}
+\def\fileversion{1.25}
+\def\filedate{2010/11/27}
\message{ v\fileversion, \filedate\space (tvz,hv)}
%
\edef\TheAtCode{\the\catcode`\@}
@@ -2061,6 +2061,21 @@ D\space##1%
\newdimen\pst@xunit
\newdimen\pst@yunit
%
+\def\pslegend{\@ifnextchar[\pslegend@i{\pslegend@i[rt]}}
+\def\pslegend@i[#1]{\@ifnextchar({\pslegend@ii[#1]}{\pslegend@ii[#1](\pst@number\pslabelsep,\pst@number\pslabelsep)}}
+\def\pslegend@ii[#1](#2,#3)#4{%
+ \gdef\pslegend@ref{#1}%
+ \xdef\pslegend@sepx{#2 }%
+ \xdef\pslegend@sepy{#3 }%
+ \gdef\pslegend@text{#4}}
+%
+\newpsstyle{legendstyle}{fillstyle=solid,fillcolor=white,linewidth=0.5pt}
+%
+\def\pslegend@iii[#1](#2){\rput[#1](#2){\psframebox[style=legendstyle]{%
+ \footnotesize\tabcolsep=2pt%
+ \tabular[t]{@{}ll@{}}\pslegend@text\endtabular}}\global\let\pslegend@text\relax}
+\let\pslegend@text\relax% define it as empty
+%
\def\psgraph{\pst@object{psgraph}}
\def\psgraph@i{\pst@getarrows\psgraph@ii}
\def\psgraph@ii(#1,#2){\catcode`\!=12\relax
@@ -2160,11 +2175,27 @@ D\space##1%
\ifx\psk@yAxisLabelPos\@empty\uput[90](#1,#6){\psk@yAxisLabel}%
\else\expandafter\setyLabelC@@r\psk@yAxisLabelPos(#4,#6)(#1,#2)\fi%
\fi%
+ \def\lt@@{lt}\def\lb@@{lb}\def\rb@@{rb}%
+ \ifx\pslegend@ref\lb@@ \gdef\pslegend@coor{#3 \pslegend@sepx \pst@number\psxunit div add
+ \pslegend@sepy \pst@number\psyunit div}%
+ \else%
+ \ifx\pslegend@ref\lt@@ \gdef\pslegend@coor{#3 \pslegend@sepx \pst@number\psxunit div add
+ #6 \pslegend@sepy \pst@number\psyunit div sub}%
+ \else%
+ \ifx\pslegend@ref\rb@@\gdef\pslegend@coor{#5 \pslegend@sepx \pst@number\psxunit div sub
+ \pslegend@sepy \pst@number\psyunit div}%
+ \else \gdef\pslegend@coor{#5 \pslegend@sepx \pst@number\psxunit div sub
+ #6 \pslegend@sepy \pst@number\psyunit div sub}%
+ \fi%
+ \fi%
+ \fi%
+ \xdef\psgraphLLx{#3}\xdef\psgraphLLy{#4}\xdef\psgraphURx{#5}\xdef\psgraphURy{#6}%
%\ignorespaces
}
%
\def\endpsgraph{%
% \pst@killglue%
+ \ifx\relax\pslegend@text\relax \else\pslegend@iii[\pslegend@ref](!\pslegend@coor)\fi%
\endpspicture%
\endgroup\ignorespaces}
%