I was trying to implement this method (How to import ASCII coordinates to TikZ) to import coordinates and draw them, but I am having this problem

Undefined control sequence \end{tikzpicture}
Extra }, or forgotten \endgroup \end{tikzpicture}
Extra \endgroup \end{tikzpicture}
Extra \endgroup \end{tikzpicture}
Too many }'s \end{tikzpicture}
Extra \endgroup \end{tikzpicture}
\begin{document} ended by \end{tikzpicture}. \end{tikzpicture}
Extra \endgroup \end{tikzpicture}
Too many }'s \end{tikzpicture}
Extra \fi \end{tikzpicture}

My code is simply

%Defining loops for tikz


\usetikzlibrary{shapes,arrows, calc}



   \myloop\read\bar to\res\shade[ball color=blue]\res;\repeat

It works whenever I do not include the package pgfplots, but I need this package for some plots. Is there any other way to make it work? Thanks in advance.


sorry I forgot to include this. File borrar.tex is just the coordinates for two lines

(0.000000,0.000000) -- (0.000000,2.000000) 
(0.000000,0.000000) -- (2.000000,2.000000) 

Error in the logfile

! Undefined control sequence.
\endtikzpicture ...r@layerlist@globally \endscope 
                                              \let \pgf@baseline =\pgf@s...
l.17 \end{tikzpicture}
  • Welcome to TeX.SX! Instead of the shortened error messages, please report what's in the log file, which is usually more informative. For instance the first error message is about \endscope. Another thing: we don't have borrar.tex and can't guess its contents.
    – egreg
    Nov 23, 2013 at 22:03
  • Thanks for your comment! Should I include the entire log file? It is pretty long.
    – balborian
    Nov 23, 2013 at 22:14
  • No, that should be sufficient.
    – egreg
    Nov 23, 2013 at 22:15
  • If you want to read the coordinates line by line from the file you need to use \readline instead of \read. Nov 24, 2013 at 10:31
  • 3
    I'm voting to close this question as off-topic because with PGFPlots v1.14 the given example compiles without any error message (when not using the external library, which wasn't explicitly mentioned in the question). Nov 10, 2016 at 21:31


Browse other questions tagged .