I have this script of plotting bar graph with min(-ve) and max(+ve)
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotstableread{
Year FarMin FarMax NearMin NearMax HereMin HereMax
1930 -20 50 -10 30 -15 40
1940 -10 60 -15 60 -20 70
1950 -15 78 -20 20 -32 42
1960 -20 30 -15 40 -20 10
1970 -5 30 -30 40 -15 20
}\datatable
\begin{document}%
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Population,
ybar,
enlarge x limits=0.15,
bar width=0.8em,
after end axis/.append code={
\draw ({rel axis cs:0,0}|-{axis cs:0,0}) -- ({rel axis cs:1,0}|-{axis cs:0,0});
}
]
\addplot +[forget plot] table {\datatable};
\addplot table [y index=2] {\datatable};
\addplot +[forget plot] table [y index=3] {\datatable};
\addplot table [y index=4] {\datatable};
\addplot +[forget plot] table [y index=5] {\datatable};
\addplot table [y index=6] {\datatable};
\legend{Far,Near,Here}
\end{axis}
\end{tikzpicture}
\end{document}
But, when I want to plot a graph with positive min values , I'm getting graph which is starting with zero instead of given positive value.
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotstableread{
Year FarMin FarMax NearMin NearMax HereMin HereMax
1930 20 50 10 30 15 40
1940 10 60 15 60 20 70
1950 15 78 20 20 32 42
1960 20 30 15 40 20 10
1970 5 30 30 40 15 20
}\datatable
\begin{document}%
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Population,
ybar,
enlarge x limits=0.15,
bar width=0.8em,
after end axis/.append code={
\draw ({rel axis cs:0,0}|-{axis cs:0,0}) -- ({rel axis cs:1,0}|-{axis cs:0,0});
}
]
\addplot +[forget plot] table {\datatable};
\addplot table [y index=2] {\datatable};
\addplot +[forget plot] table [y index=3] {\datatable};
\addplot table [y index=4] {\datatable};
\addplot +[forget plot] table [y index=5] {\datatable};
\addplot table [y index=6] {\datatable};
\legend{Far,Near,Here}
\end{axis}
\end{tikzpicture}
\end{document}
Please help me to plot the graph with positive min values. thanks!


