Pgf / tikz: String characters as input coordinates

I am new to pgf, so I tried some examples from the pgfplot manual. One example is especially important for my current task, but alas, it will not compile.

Here is the code:

\documentclass[11pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[symbolic x coords={a,b,c,d,e,f,g,h,i}] \addplot+[smooth] coordinates { (a,42) (b,50) (c,80) (f,60) (g,62) (i,90)}; \end{axis} \end{tikzpicture} \end{document} 

the compiler exits with the following error:

 ! Package PGF Math Error: Could not parse input 'a' as a floating point number, sorry. The unreadable part was near 'a'.. 

I do not know how to fix this behavior. Other charts (smooth, scattered, bars) that contain only numerical data are compiled with a fine.

Can someone give me a hint?

Greetings

TO.

+7
string plot tikz axis pgf
source share
1 answer

You need to include this in the preamble:

 \pgfplotsset{xticklabel={\tick},scaled x ticks=false} \pgfplotsset{plot coordinates/math parser=false} 

I had problems with this command when I tried to use it (in particular, “coordinate graph / mathematical parser”), but then I updated the pgfplots package and it all worked.

+1
source share

All Articles