0

Please consider this code:

\documentclass[11pt]{article}

\begin{filecontents*}{table.dat}
type    v1  v2  v3 v4 v5  v6 v7
t1 0 0 0 0 0 0 0 0 0 0 0 0 0 6
t2 5 17 4 0 0 0 21 0 133 4 91 0 1 93
t3 18 0 0 0 18 0 15 0 0 111 37 0 0 48
t4 12 0 14 0 0 0 18 0 38 0 38 0 0 30
t5 3 69 4 0 64 0 69 0 80 29 6 0 1 21
t6 28 4 10 0 10 0 33 6 58 0 48 0 21 29
t7 25 144 2 0 0 0 180 0 200 0 193 0 52 370
\end{filecontents*}

\usepackage{pgfplots}
\pgfplotsset{compat=1.3}

\usepackage{lipsum}

\begin{document}
  \lipsum[1]
  \begin{figure}[h]
    \noindent
    \begin{tikzpicture}
    \begin{axis}[
      ybar=2pt,
      bar width=3pt,
      width=\textwidth,
      height=3cm,
      axis lines=none,
      ytick=\empty,
      symbolic x coords={ t1, t2, t3, t4, t5, t6, t7 }
    ]

    \addplot table[x=type, y=v1] {table.dat};
    \addplot table[x=type, y=v2] {table.dat};
    \addplot table[x=type, y=v3] {table.dat};
    \addplot table[x=type, y=v4] {table.dat};
    \addplot table[x=type, y=v5] {table.dat};
    \addplot table[x=type, y=v6] {table.dat};
    \addplot table[x=type, y=v7] {table.dat};

    \end{axis}
    \end{tikzpicture}
  \end{figure}
  \lipsum[1]
\end{document}

As you can see, I have only two very high bars that make everything else indiscernible.

output

For various reasons I don't like the idea to use a log axis just for these two values.

Is there a way to truncate in some way the tall bars, so that they have a manageable height? In contrast to just tweak the data to have a smaller bar, I'm looking for something that visually hints at this truncation.

7

0

Browse other questions tagged .