# Stacked bar chart with symbolic coordinates

I am struggling with creating a stacked bar chart and I am not really sure why it is not working. Attached a minimal working example.

I have 2 problems. a) One bar should fill the range 0-30, the second one 0-70 and I want them to overlap. It seems to add up the values which means that it is 30+70 and the second bar thus extends until 100.

b) I defined several bars ranging from a to g, but for unknown reason a and b are swallowed and the plot only uses c to g.

Sorry for the questions, but I spend some time comparing my code to stacked bar examples and I just don't see what my problem is here. Does anyone see what the issue is?

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots, pgfplotstable}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xmin=60,
xmax=100,
xbar stacked,
xmajorgrids = true,
bar width=1mm,
width=11.5cm,
height=10cm,
xlabel={Accuracy \%},
symbolic y coords={a,b,c,d,e,f,g},
ytick=data
]

\end{axis}
\end{tikzpicture}
\end{figure}

\end{document}


The [xbar stacked] option means the add the next bar to the right of the first (starting at xmin). Actually, your biggest problem was [xmin=60] which cut out all the orange bars.

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots, pgfplotstable}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xmin=0,
xmax=100,
xbar=-1mm,
xmajorgrids = true,
bar width=1mm,
width=11.5cm,
height=10cm,
xlabel={Accuracy \%},
symbolic y coords={a,b,c,d,e,f,g},
ytick=data
]

\end{axis}
\end{tikzpicture}
\end{figure}

\end{document}


I think you should begin by drawing the black plot :

But I didn't see the other issue.

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots, pgfplotstable}

\begin{document}

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xmin=60,
xmax=100,
xbar stacked,
xmajorgrids = true,
bar width=1mm,
width=11.5cm,
height=10cm,
xlabel={Accuracy \%},
symbolic y coords={a,b,c,d,e,f,g},
ytick=data
]