[Tex/LaTex] Problem using matlab2tikz

graphicsMATLABpgfplotsplottikz-pgf

I'm trying to get matlab2tikz to work. I want to use it for prettyfying output of Matlab's image() command.

In Matlab I tried

imagesc(rand(100));
xlabel('X');
ylabel('Y');
title('Random Colors');
matlab2tikz('image.tikz');

but when I do

\usepackage{pgfplots}
\input{../../../../src/image.tikz}

it get error

ERROR: Package pgfkeys Error: I do not know the key '/tikz/y dir' and I am going to ignore it. Perhaps you misspelled it.

Also when I try the matlab2tikz recommended settings

\pgfplotsset{compat=newest} % For best results

I get a similar error

ERROR: Package pgfkeys Error: I do not know the key '/pgfplots/compat' and I am going to ignore it. Perhaps you misspelled it.

How do I determine if my pgfplots version is too old? I'm on Ubuntu 11.10. The latest version of pgfplots itself is 1.5.

Best Answer

The keys in question have been introduced in pgfplots version 1.3 . I suppose your TeX version comes with pgfplots 1.2.2 . You can inspect the actual versions on your system by looking into the .log file: in always contains the versions of every loaded package (search for 'pgfplots').