3

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's user avatar
samcarter_is_at_topanswers.xyz
202k16 gold badges279 silver badges672 bronze badges
asked17 hours ago
Patricio's user avatar
0

2 Answers2

4
  • 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}

enter image description here

answered17 hours ago
samcarter_is_at_topanswers.xyz's user avatar
3

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}

enter image description here

samcarter_is_at_topanswers.xyz's user avatar
samcarter_is_at_topanswers.xyz
202k16 gold badges279 silver badges672 bronze badges
answered17 hours ago
kabenyuk's user avatar

You mustlog in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.