I'm trying to build a figure on beamer that has a single point on it. I've tried what I'd usually have done in other settings (article, book), but I'm still getting an error. In particular, I get
! Package pgfplots Error: Could not read table file '" x y label\\ 3 12 $x$\\ "' in 'search path=.'. In case you intended to provide inline data: maybe TeX screwed up your end-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the pgfplotstable manual for details).See the pgfplots package documentation for explanation.However, as it is apparent from my code, I'm already usingrow sep=crcr
My code is
\documentclass{beamer}\usepackage{tikz}\usepackage{pgfplots}\begin{document}\begin{frame} \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=left, axis equal image, axis on top, ticks = none, xmin=0,xmax=20, ymin=0,ymax=20] \addplot+[only marks,row sep=crcr,mark=*,black,mark options={fill=black},nodes near coords,nodes near coords align=right,point meta=explicit symbolic ] table[meta=label]{ x y label\\ 3 12 $x$\\ }; \end{axis} \end{tikzpicture}\end{frame}\end{document}samcarter_is_at_topanswers.xyz
202k16 gold badges279 silver badges672 bronze badges
2 Answers2
- remove the
\\, they will cause an error regardless of the class - use a fragile frame
\documentclass{beamer}\usepackage{tikz}\usepackage{pgfplots}\pgfplotsset{compat=newest}\begin{document}\begin{frame}[fragile] \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=left, axis equal image, axis on top, ticks = none, xmin=0,xmax=20, ymin=0,ymax=20] \addplot+[only marks,row sep=crcr,mark=*,black,mark options={fill=black},nodes near coords,nodes near coords align=right,point meta=explicit symbolic ] table[meta=label]{ x y label 3 12 $x$ }; \end{axis} \end{tikzpicture}\end{frame}\end{document} answered17 hours ago
samcarter_is_at_topanswers.xyz
202k16 gold badges279 silver badges672 bronze badges
It works for me this way.Note the following:row sep=crcr is placed insidetable[...]. The lines end with\\.
\documentclass{beamer}\usepackage{tikz}\usepackage{pgfplots}\pgfplotsset{compat=1.18}% <============\begin{document}\begin{frame} \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=left, axis equal image, axis on top, ticks = none, xmin=0,xmax=20, ymin=0,ymax=20] \addplot+[only marks,mark=*,black,mark options={fill=black},nodes near coords,nodes near coords align=right,point meta=explicit symbolic ] table[row sep=crcr, meta=label] { x y label\\ 3 12 $x$\\ }; \end{axis} \end{tikzpicture}\end{frame}\end{document}samcarter_is_at_topanswers.xyz
202k16 gold badges279 silver badges672 bronze badges
You mustlog in to answer this question.
Explore related questions
See similar questions with these tags.


