summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-bar
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-11-28 00:40:04 +0000
committerKarl Berry <karl@freefriends.org>2008-11-28 00:40:04 +0000
commit1c4b9b9cf2ef89c3c82f326b01ad001a45989092 (patch)
tree9a4e1b5d732fbd7f685762b3bcbd77d5f790ad7b /Master/texmf-dist/tex/generic/pst-bar
parentd5c8adb97c81f485da34580a1811835fafe84915 (diff)
pst-bar 0.92 (26nov08)
git-svn-id: svn://tug.org/texlive/trunk@11440 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-bar')
-rw-r--r--Master/texmf-dist/tex/generic/pst-bar/pst-bar.tex119
1 files changed, 54 insertions, 65 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-bar/pst-bar.tex b/Master/texmf-dist/tex/generic/pst-bar/pst-bar.tex
index 407c75d7496..2d6b18fbc8e 100644
--- a/Master/texmf-dist/tex/generic/pst-bar/pst-bar.tex
+++ b/Master/texmf-dist/tex/generic/pst-bar/pst-bar.tex
@@ -1,21 +1,49 @@
+%% $Id: pst-bar.tex 63 2008-11-26 18:00:46Z herbert $
+%%
+%%
+%% This is file `pst-bar.tex',
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Package `pst-bar.tex'
+%%
+%% Alan Ristow
+%% Herbert Voss <Herbert.Voss _at_ pstricks.de>
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `pst-bar' is a PSTricks package for additionals to the standard
+%% pstricks package
+%%
\csname PSTBarLoaded\endcsname%
\let\PSTBarLoaded\endinput%
-\ifx\PSTplotLoaded\endinput\else\input pst-plot.tex\fi%
-\pstheader{pst-bar.pro}%
-\input pst-key.tex%
+\ifx\PSTricksLoaded\endinput\else\input pstricks \fi
+\ifx\PSTplotLoaded\endinput\else\input pst-plot \fi
+\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
+
-\def\fileversion{0.7a}
-\def\filedate{2004/09/24}
+\def\fileversion{0.92}
+\def\filedate{2008/11/26}
\message{`pst-bar' v\fileversion, \filedate\space (Alan Ristow)}%
-\define@key{psset}{barsep}{\edef\psk@barsep{#1}}%
-\define@key{psset}{barcolsep}{\edef\psk@barcolsep{#1}}%
-\define@key{psset}{barstyle}{\edef\psk@barstyle{#1}}%
-\define@key{psset}{barlabelrot}{\edef\psk@barlabelrot{#1}}%
-\setkeys{psset}{barsep=0.0,barcolsep=0.4,barstyle=\@empty,barlabelrot=0}%
+\pstheader{pst-bar.pro}%
+\pst@addfams{pst-bar}
+
+\newlength\psk@labelwidth%
+\define@key[psset]{pst-bar}{barsep}{\edef\psk@barsep{#1}}%
+\define@key[psset]{pst-bar}{barcolsep}{\edef\psk@barcolsep{#1}}%
+\define@key[psset]{pst-bar}{barstyle}{\def\@barstylelist{#1}}%
+\define@key[psset]{pst-bar}{barlabelrot}{\edef\psk@barlabelrot{#1}}%
+\define@key[psset]{pst-bar}{labelalign}{\def\psk@labelalign{#1}}%
+\define@key[psset]{pst-bar}{labelwidth}{\setlength\psk@labelwidth{#1}}%
+\def\psk@labelalign{\centering}%
+\setlength\psk@labelwidth{0.5in}%
%
% chartstyle=cluster|stack|block (0,1,2)
-\def\psset@chartstyle#1{\pst@expandafter\psset@@chartstyle{#1}\@nil\psk@chartstyle}
+\define@key[psset]{pst-bar}{chartstyle}{\pst@expandafter\psset@@chartstyle{#1}\@nil\psk@chartstyle}%
\def\psset@@chartstyle#1#2\@nil#3{%
\ifx#1c\let#3\z@\else
\ifx#1s\let#3\@ne\else
@@ -25,10 +53,8 @@
\fi
\fi
}%
-\psset@chartstyle{cluster}%
-%
% orientation=vertical|horizontal (0,1)
-\def\psset@orientation#1{\pst@expandafter\psset@@orientation{#1}\@nil\psk@orientation}
+\define@key[psset]{pst-bar}{orientation}{\pst@expandafter\psset@@orientation{#1}\@nil\psk@orientation}%
\def\psset@@orientation#1#2\@nil#3{%
\ifx#1h\let#3\p@\else
\ifx#1v\let#3\z@\else
@@ -36,11 +62,7 @@
\fi
\fi
}%
-\psset@orientation{vertical}%
-
-\def\psset@header#1{%
- \pst@expandafter\psset@@header{#1}\@nil\psk@header
-}%
+\define@key[psset]{pst-bar}{header}{\pst@expandafter\psset@@header{#1}\@nil\psk@header}%
\def\psset@@header#1#2\@nil#3{%
\ifx#1t\let#3\z@\else
\ifx#1f\let#3\@ne\else
@@ -48,7 +70,8 @@
\fi
\fi
}%
-\psset@header{true}%
+\psset[pst-bar]{barsep=0.0,barcolsep=0.4,barstyle=\@empty,barlabelrot=0,%
+ chartstyle=cluster,orientation=vertical,header=true}%
\def\psbarchart{\def\pst@par{}\pst@object{psbarchart}}%
\def\pstbar@header{\@empty}%
@@ -65,7 +88,6 @@
% Define bar chart styles
-\def\psset@barstyle#1{\def\@barstylelist{#1}}%
\def\newpsbarstyle#1#2{\@namedef{psbarcs@#1}{\psset{#2}}}%
\def\begin@barstyle{\def\pst@tempd{/barstyles [ }}%
@@ -119,7 +141,8 @@
\newpsbarstyle{lightgray}{fillcolor=lightgray,fillstyle=solid,framearc=0}%
\newpsbarstyle{darkgray}{fillcolor=darkgray,fillstyle=solid,framearc=0}%
-\psset@barstyle{black,darkgray,gray,lightgray,white,red,green,blue}%
+%\psset@barstyle{black,darkgray,gray,lightgray,white,red,green,blue}%
+\psset[pst-bar]{barstyle={black,darkgray,gray,lightgray,white,red,green,blue}}%
\def\readpsbardata{\@ifnextchar[{\readpsbardata@i}{\readpsbardata@i[]}}
@@ -193,7 +216,7 @@
\psbar@trimspaces\pst@tempa%
\advance\pst@dima by 1pt%
\def\pst@tempb{\strip@pt\pst@dima}%
- \uput[-90]{\psk@barlabelrot}(\pst@tempb,-\psbarlabelsep){\psbarlabel{\pst@tempa}}%
+ \uput[-90]{\psk@barlabelrot}(\pst@tempb,-\psbarlabelsep){\psbarlabel{\parbox{\psk@labelwidth}{\psk@labelalign\pst@tempa}}}%
\@ifnextchar\@nil{\@gobble}{\pstbar@xlabels@i}%
}%
@@ -219,7 +242,7 @@
\psbar@trimspaces\pst@tempa%
\advance\pst@dima by -1pt%
\def\pst@tempb{\strip@pt\pst@dima}%
- \uput[180]{\psk@barlabelrot}(-\psbarlabelsep,\pst@tempb){\psbarlabel{\pst@tempa}}%
+ \uput[180]{\psk@barlabelrot}(-\psbarlabelsep,\pst@tempb){\psbarlabel{\parbox{\psk@labelwidth}{\psk@labelalign\pst@tempa}}}%
\@ifnextchar\@nil{\@gobble}{\pstbar@ylabels@i}%
}%
@@ -314,8 +337,13 @@
/DATAVECTOR exch def
/xbar1 colcount colwidth mul bXoffset add def
/xbar2 xbar1 barwidth add def
+ /count 0 def
DATAVECTOR {
- /ybar2 exch \psbar@psop \psbar@mul mul \pst@number\pst@dimb mul ybar1 add def
+ count 0 eq {
+ /ybar2 exch \psbar@psop \psbar@mul mul \pst@number\pst@dimb mul ybar1 add def
+ }{
+ /ybar2 exch \psbar@mul mul \pst@number\pst@dimb mul ybar1 add def
+ } ifelse
ybar1 ybar2 ne { % if ybar1 == ybar2, don't stroke a path
newpath
barstyles barcount get cvx exec
@@ -323,6 +351,7 @@
} if
/ybar1 ybar2 def
/barcount barcount 1 add def
+ /count count 1 add def
} forall
/barcount 0 def
/ybar1 0 def
@@ -378,43 +407,3 @@
\endinput
-\iffalse
-%% CHANGE-LOG
- v 0.7a 2004/09/24
- Removed some debugging code that was accidentally left in the last release.
- The removed code was harmless, but caused confusion for some users.
-
- v 0.7 2004/09/15
- Made a minor change to \psbarscale so its functionality would be more
- closely analogous to the \pstScale command from the pstricks-add pacakge.
- Improved documentation. Set default barstyle to list of all available
- barstyles. First release to CTAN.
-
- v 0.6 2004/09/09
- Added orientation parameter and horizontal bar-drawing capability. Removed
- erroneous correction factor for linewidth from stacked bar chart.
-
- v 0.5 2004/09/02
- Added header parameter for \readpsbardata. Improved handling of headers in
- the data file -- spaces may now be included in a header item, though commas
- still may not.
-
- v 0.4 2004/08/29
- Added "block" chartstyle. Updated \readpsbardata to use .csv for both
- header and data. Introduced \psbarscale command. First release to pstricks
- mailing list, 2004/09/01.
-
- v 0.3 2004/08/26
- Added command \readpsbardata to read data for bar chart directly from a
- .csv file with the first row containing the column labels.
-
- v 0.2a 2004/08/23
- Changed colsep parameter name to barcolsep to avoid clash with psmatrix.
-
- v 0.2 2004/08/22
- Added stacked bar chart, chartstyle parameter, and introduced pst-bar.pro
- prologue with transpose command.
-
- v 0.1 2004/08/21
- Clustered bar chart.
-\fi