# 'Undefined control sequence' with \addplot

When trying to insert a TikZ figure, using \addplot, I've got an 'undefined control sequence'. My code is:

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

\begin{document}

\begin{tikzpicture}[scale=2]
\addplot[only marks] file[x index=0, y index=1]{baba.txt};
\end{tikzpicture}

\end{document}


where baba.txt is just the simple table:

0 1
1 0
1 1
0 0


Can anyone help me with this?

• what is the exact error after that message ? – percusse Jun 22 '16 at 18:26
• Are you missing axis environment? – Jeffery Shivers Jun 22 '16 at 18:29

Is this what you want?

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