# Symbolic Coordinates not showing

So I'm just learning LaTeX so I'm sorry if this is a dumb question, but i've read the manual, watched youtube videos and read blogs and I still can't figure out why this is not working. I want to do a simple bar graph. Everything goes well in showing the data until I try to add the code that makes it actually look like a bar graph, then, the last coordinate disappears and I do not know why. This is my code, I've linked "pgfplots" at the top (and also "pgf-pie for another graph, if that might be relevant):

\begin{tikzpicture}
\begin{axis}[
%title= ,
ymin=0, ymax=10,
x tick label style={/pgf/number format/1000 sep=},
ybar interval=1,
xlabel={$estado$},
ylabel={$frecuencia$},
symbolic x coords={CA,TX,AZ},
xtick=data,
]

\addplot coordinates { (CA,9) (TX,8) (AZ,8)};

\end{axis}
\end{tikzpicture}


The issues start when i add these two lines, which i got from overleaf:

x tick label style={/pgf/number format/1000 sep=},
ybar interval=1


Does anyone know why this is happening and how can I make a bar graph? Thank you

• Welcome to TeX.SE! Please -- as usual here -- make your code snippets compilable, then we do not have to guess what you are doing ... Sep 21, 2020 at 8:41

With more complex input data, the coordinate plot can quickly become confusing (I would only use the coordinate plot for adding individual points or similar).
Usually you have a table of input data of the kind

X         Y
CA        9
TX        8
AZ        8


So it's good to know how to do this as a table plot.

symbolic x coords={CA,TX,AZ}, is not needed here, instead:
xticklabels from table={\inputdata}{X}, % <--- !

\documentclass[margin=3mm, tikz]{standalone}
\usepackage{pgfplotstable} % <--- !
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}

X         Y
CA        9
TX        8
AZ        8
}\inputdata

\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin=0, ymax=10,
%x tick label style={/pgf/number format/1000 sep=},% not used
ybar,                       % changed
enlarge x limits = 0.4,     %  new
ylabel=\textit{frecuencia},
%symbolic x coords={CA,TX,AZ}, % not needed
xticklabels from table={\inputdata}{X}, % <--- !
xtick=data,
]
\end{axis}
\end{tikzpicture}
\end{document}

• Thank you so much, I understand much better and it works now! <3 Sep 21, 2020 at 15:16

I guess that you looking for something like this:

\documentclass[margin=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin=0, ymax=10,
x tick label style={/pgf/number format/1000 sep=},
ybar,                       % changed
enlarge x limits = 0.4,     %  new

• @Kraken, it add space before and after diagram. To see effect, in test remove option enlarge x limits. What you mean with "helped too". Is suggested solution what you looking for? Sep 21, 2020 at 15:33