# Bar from bar chart without value

I would like to add a single bar to my chart, but without any value. Unfortunately when I skip adding proper value with label x in coordinates, it (bar with label x) disappears from chart.

\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
ybar,
enlargelimits=0.10,
legend style={at={(0.5,-0.2)},
anchor=north,legend columns=-1},
symbolic x coords={A,B,C},
xtick=data,
nodes near coords,
nodes near coords align={vertical},
x tick label style={rotate=45,anchor=east},
]
\end{axis}
\end{tikzpicture}


In this example bar A (and label A) will not appear on the chart. Anybody knows how to put this x label to chart?

-
I don't understand: Do you want just the x tick label A, or do you also want a bar at that position? If you do want a bar, what length should that bar have? –  Jake Jun 13 '14 at 12:20
I want only x label for A, without any bar value (length=0). –  marcin Jun 13 '14 at 13:10

Here is a suggestion using

   symbolic x coords={A,B,C},
xtick={A,B,C},
xmin=A,
ymin=0,
enlarge y limits={0.1,upper},


Code:

\documentclass[margin=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
ybar,
enlargelimits=0.10,
legend style={at={(0.5,-0.2)},
anchor=north,legend columns=-1},
symbolic x coords={A,B,C},
xtick={A,B,C},
xmin=A,
ymin=0,
enlarge y limits={0.1,upper},
nodes near coords,
nodes near coords align={vertical},
x tick label style={rotate=45,anchor=east},
]
\end{axis}
\end{tikzpicture}
\end{document}

-
Thanks! This is what I was looking for. For C bar works similarly (xmax=C,ymin=0). –  marcin Jun 13 '14 at 15:20

Another one with testing value of the bar value and deciding to put the node near coord or not. In case you need it for some obscure reason. The test should have been easier but somehow ifthenelse is not overloaded in this context. The output is the same as above

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
ybar,ymin=0,enlarge y limits=false,
enlarge x limits=0.10,
legend style={at={(0.5,-0.2)},
anchor=north,legend columns=-1},
symbolic x coords={A,B,C},
xtick=data,
nodes near coords*={%
\pgfmathprintnumberto[fixed,assume math mode]{\pgfplotspointmeta}{\temp}%
\ifnum\temp=0\else\pgfmathprintnumber{\pgfplotspointmeta}\fi%
},
nodes near coords align={vertical},
x tick label style={rotate=45,anchor=east},
]