[Tex/LaTex] pgfplots – bar chart with bars starting at -120 instead of 0

pgfplots

I would like a plot like the one here shown (wanted)
As using ybar, the origin is fixed at 0, I'm getting a plot with the bars starting from zero instead of -120.

bar chart wanted from MSexcel

Best Answer

You can shift the labels with an offset

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\pgfplotstableread{
a b c
1 10 20
2 45 130
3 30 60
}\mytable
\begin{document}
\begin{tikzpicture}
\begin{axis}[ybar,xtick=data,enlarge y limits={upper=5},ymin=0,
yticklabel={\pgfmathparse{\tick-120}\pgfmathprintnumber{\pgfmathresult}}]
\addplot table[x=a,y=b] {\mytable};
\addplot table[x=a,y=c] {\mytable};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here