Choosing color mix for lines in pgfplots

I'm somewhat baffled by my apparent inability to choose a mix of colors in pgfplots. Here's a MWE:

\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.4}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}[scale=1.0]

\begin{axis}[enlargelimits=false,
xtick={-3.141,0,3.141},
xticklabels={$-\pi$,$0$,$\pi$}]
\end{axis}

\end{tikzpicture}
\end{document}


I would have expected a color in between red and black, but I get just black. If I choose the color as color=black!0.4!red it turns out to be red. What am I doing wrong?

-

You need to use percentages rather than fractions. red!40!black works.

I had to remove the \pgfplotsset{compat=1.4} line from your source code because it prevented compilation. Nevertheless, the following code produces a mixture of black and red. Apparently red!0.4!black gives you 0.4% red and 99.6% black (assuming decimal inputs are accepted). Otherwise, it would round to 0% and 100%.

\documentclass[10pt]{article}
\usepackage{pgfplots}
%\pgfplotsset{compat=1.4}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}[scale=1.0]

\begin{axis}[enlargelimits=false,
xtick={-3.141,0,3.141},
xticklabels={$-\pi$,$0$,$\pi$}]

 You might want to update your packages as I can compile with or without \pgfplotsset{compat=1.4} commented, so wondering if you have a really old version of the packages. – Peter Grill Feb 17 '12 at 0:54 Thanks, Peter. I presumed that was the case. My texlive distribution is certainly out of date because I'm running the version from the debian testing repositories, which I believe is TexLive 2009. I have avoided updating because packages outside the repositories associated with a given version of debian often times cause problems. – user001 Feb 17 '12 at 0:57
You have to provide the mix in percent. You meant Red 40% on Black, that's color=red!40!black