[pstricks] Problem generating a stacked chart with gradient fill styles

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri Jan 25 18:32:27 CET 2008


DigiFuga (Bas Dekker) schrieb:

> I would like to produce a chart with a gradient in the fillstyles of the 
> bars, because it matches my company's style rules better. I use pst-bar 
> and pst-grad
> 
> There is a model file by Herbert Voß on the internet at 
> http://ftp.ktug.or.kr/tex-archive/info/examples/PSTricks4_de/27-3-2.ltx.

I see ...
I used a modified version of pst-bar, which is not on CTAN :-(

This should work:

\documentclass{article}
\pagestyle{empty}
\setlength\parindent{0pt}

\usepackage{pstricks,pst-bar,pst-grad}
\newpsbarstyle{rG}{fillstyle=gradient,gradangle=0,gradbegin=red,gradend=white}
\newpsbarstyle{bG}{fillstyle=gradient,gradangle=0,gradbegin=blue,gradend=white}
\usepackage{filecontents}
\begin{filecontents*}{data1T.csv}
1300--1349, 1350--1399, 1400--1449, 1450--1499
1, 0.5, 2, 0.5
1, 2, 1.5, 1
\end{filecontents*}

\begin{document}
\renewcommand*{\psbarlabel}{\small\itshape}
\readpsbardata{\data}{data1T.csv}
\begin{pspicture}(-0.5,-1.75)(4,2)
   \psaxes[axesstyle=frame,Ox=0,Dx=1,Dy=2,
     labels=y,ticks=y](0,0)(4,2)
   \psbarchart[barlabelrot=90,
     barstyle={rG,bG},chartstyle=cluster]{\data}
\end{pspicture}

\end{document}

> \documentclass{article}
> \usepackage{pst-bar,pst-grad,pstricks}

use always this order:

\usepackage{pstricks,pst-bar,pst-grad}

try again with the above example.

Herbert



More information about the PSTricks mailing list