[pstricks] table with bar chart bars?

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Apr 13 17:17:09 CEST 2011


Am 13.04.2011 16:20, schrieb maja zaloznik:
> Hi there!
>
> I was wondering if there is a more straightforward way of doing this with
> pstricks vielleicht?: http://www.keithv.com/software/barchart/
> Essentially I'd like bar chart style bars in a table column - I don't even
> need an axis really.
> Also, ideally I would want to use it in a longtable environment if that is
> relevant at all.

that is an ordinary tabular and should also be possible with a
data set, if tehre are a lot of data records


\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo,tgpagella}
\usepackage{booktabs,longtable,pst-plot}
\SpecialCoor

\psset{xunit=0.75}

\def\Bar#1 \pm #2;{%
   \psframe[fillstyle=solid,fillcolor=black!20](!#1 6 sub 0.5)%
   \rput(!#1 6 sub 0.25){\psline{|-|}(-#2,0)(#2,0)}}
\begin{document}

\def\arraystretch{2}
\begin{longtable}{@{} l l r l @{}}\toprule
Smoothing  & Inter-   &  PER $\pm1$ sd & \\[-5mm]
method     & polation &                & \\\midrule
\endhead
Good-Turing           & no  & $8.28 \pm 0.12$ & \Bar8.28 \pm 0.12;\\
Witten--Bell          & no  & $8.00 \pm 0.13$ & \Bar8.00 \pm 0.13;\\
absolute disc. of 0.9 & no  & $11.71 \pm 0.14$ & \Bar11.71 \pm 0.14;\\
original Kneser--Ney  & no  & $8.62 \pm 0.13$ & \Bar8.62 \pm 0.13;\\
modified Kneser--Ney  & no  & $9.18 \pm 0.13$ & \Bar9.18 \pm 0.13;\\
Witten--Bell          & yes & $7.68 \pm 0.12$ & \Bar7.68 \pm 0.12;\\
absolute disc. of 0.5 & yes & $8.03 \pm 0.13$ & \Bar8.03 \pm 0.13;\\
absolute disc. of 0.8 & yes & $7.56 \pm 0.13$ & \Bar7.56 \pm 0.13;\\
absolute disc. of 0.9 & yes & $7.52 \pm 0.12$ & \Bar7.52 \pm 0.12;\\
absolute disc. of 1.0 & yes & $8.24 \pm 0.13$ & \Bar8.24 \pm 0.13;\\
original Kneser--Ney  & yes & $6.86 \pm 0.12$ & \Bar6.86 \pm 0.12;\\
modified Kneser--Ney  & yes & $6.75 \pm 0.12$ & \Bar6.75 \pm 0.12;\\[-4mm]
\rule[-5mm]{0pt}{0mm} & & &
        \makebox[5cm][l]{\psaxes[yAxis=false,Ox=6.0,Dx=2,
                xticksize=0 2mm,xsubticksize=0.5](6,0)}\\\bottomrule
\end{longtable}

\end{document}

Herbert


More information about the PSTricks mailing list