# Why does PGFplots not recognize my expression?

I want to graph two quadratic equations using pgfplots. The first one work fine, however when I add the second equation, I get the following error message:

Package PGF Math Error: Unknown operator x' or x+' (in 'x^2 - 3x + 4').


It seems PGFplots will not let me multiply numbers at all. Functions such as 2x or even x * 2 don't seem to work. Here is what I am working with:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{tikzpicture}
\begin{axis}[
axis lines = center,
xlabel = {$x$},
ylabel = {$y = f(x)$}
]
\addplot[no markers, blue]{x^2 - 3x + 4};
\end{axis}
\end{tikzpicture}


The red plot works fine, but the blue one causes a compilation error.

pgfplots doesn't assume multiplication between scalars and variables, so your expression should be x^2 - 3*x + 4:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = center,
xlabel = {$x$},
ylabel = {$y = f(x)$}
]

• Figured it out, I removed \tracingall and that caused it to work. Thanks! – Joe the Person Sep 27 '14 at 17:05
 \addplot[no markers, blue]{x^2-3*x+4};