Graphics, Figures & Tablespgfplots | Plot Coordinates not accepted

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pranav
Posts: 5
Joined: Mon Nov 26, 2012 9:24 am

pgfplots | Plot Coordinates not accepted

Post by pranav »

Hi,

I want to plot following data using pgfplots.

Code: Select all

(1.3 , 0.006418)
(1.6 , 0.015143)
(1.9 , 0.010009)
(2.2 , 0.014109)
(2.5 , 0.009640)
I am adding here a snippet from the source file used for plotting it:

Code: Select all

\begin{figure}
  \begin{tikzpicture}
    \begin{axis}[
      height=4cm,
      width=9cm,
      grid=major,
      xlabel=Distance,
      ylabel=\% deviation from mean,
      xmin=1.2,
      xmax=2.6,
      domain=1.2:2.6
    ]
      \addplot coordinates {(1.3,0.006418),(1.6,0.015143),(1.9,0.010009),(2.2,0.014109),(2.5,0.009640)};
      \addlegendentry{CPSS}
      \addplot coordinates {(1.3,0.032756),(1.6,0.017977),(1.9,0.020863),(2.2,0.034741),(2.5,0.049633)};
      \addlegendentry{Kinect}
    \end{axis}
  \end{tikzpicture}
\end{figure}
But I am getting error:

Code: Select all

! Package pgfplots Error: Sorry, I could not read the plot coordinates near ',(
1.6,0.017977),(1.9,0.020863),(2.2,0.034741),(2.5,0.049633) '. Please check for 
format mistakes.
Last edited by cgnieder on Mon Nov 26, 2012 1:56 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

pranav
Posts: 5
Joined: Mon Nov 26, 2012 9:24 am

pgfplots | Plot Coordinates not accepted

Post by pranav »

Hi,

sorry for the silly mistake. In the code I have written

Code: Select all

\addplot coordinates {(1.3,0.006418),(1.6,0.015143),(1.9,0.010009),(2.2,0.014109),(2.5,0.009640)};
Here the comma must not be added between successive coordinates. :oops:
Last edited by cgnieder on Mon Nov 26, 2012 1:57 pm, edited 1 time in total.
Post Reply