Tikz multi-bar plot custom bar position

I have a multi-bar plot that contains single and multi bars:

I want to make the single bars A and D in the center; right now they are left aligned.

The following is the code:

\begin{tikzpicture}
\begin{axis}[
ybar, axis on top, height=8cm, width=8cm, bar width=0.6cm,  ymajorgrids, tick align=inside,
major grid style={draw=white}, enlarge y limits={value=0.1,upper}, ymin=0, ymax=40,
axis x line*=bottom, axis y line*=left, y axis line style={opacity=0}, tickwidth=0pt,
enlarge x limits=true,
ylabel={Percentage (\%)},
ylabel style={align=center},
symbolic x coords={
A,B,C,D
},
xtick=data,
nodes near coords={
\pgfmathprintnumber[precision=1]{\pgfplotspointmeta}
},
x tick label style={font=\small,text width=2cm,align=center}
]

• Welcome to TeX.SX. Those are actually center aligned. Since you don't have data in the second set (red) for A and D, those bars are not plotted but the space for that is allotted. That's why it looks left aligned. – nidhin Dec 10 '18 at 21:11