From 8c04f4af5028001802addd13c9ad12bf7c1b8e5d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 14 Dec 2010 23:17:48 +0000 Subject: pst-plot 1.25 (15dec10) git-svn-id: svn://tug.org/texlive/trunk@20743 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-plot/Changes | 2 + .../doc/generic/pst-plot/pst-plot-doc.pdf | Bin 789673 -> 806762 bytes .../doc/generic/pst-plot/pst-plot-doc.tex | 123 ++++++++++++++++++++- 3 files changed, 123 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/doc') 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 Binary files a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf and b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf 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 -- cgit v1.2.3