I would like to create a surf plot (like mesh in Matlab) with a view from the top. From a bit leasing I found this way for accomplishing that:
\begin{tikzpicture}
\begin{axis}{view={0}{90}]
\appplot3[surf] table {datafile.dat};
\end{axis}
\end{tikzpicture}
At the moment my data, that I would like to plot, is a 400 x 1000 matrix, where the values in the matrix represent the hight (or color).
In which format do I need to generate datafile.dat, so that \addplot3[surf] could read it?
I found few formats:
(x value, y value, z value)
(x value, y value)[ z value]
The easy way for me would be if I could simply generate a matrix with the size 400 x 1000, which contains the z values, and in addition to scale the values of the x-axis and y-axis.
EDIT
I generated a file at the format Jake gave. As jake said, using pdflatex returned TeX capacity exceeded, sorry [main memory size=3000000], but from the other side, lualatex returned
! Package pgfplots Error: Could not read table file '/tmp/workfile'. In case yo
u intended to provide inline data: maybe TeX screwed up your end-of-lines? Try
`row sep=crcr' and terminate your lines with `\\' (refer to the pgfplotstable m
anual for details).
which was not experted.
EDIT 2
I was able to create the following
. I used the following code for it:
\begin{tikzpicture}
\begin{axis}[view={0}{90},colormap/cool]
\addplot3[surf] table [row sep=newline] {./workfile.dat};
\end{axis}
\end{tikzpicture}
I would like that for value to have the color white and in my picture, about 90% of the values are null, but in the picture it is not the case (there is some kind of hell blue). How could it be fixed?
Is it also possible to consider only values which are bigger then a specific value?
In python matplotlib there is a possibility to use a LogNorm scale for the colors. Is it also possible in tikz (in this case)?

shader=interpalso reduces both translation time + pdf size + looks better for such resolutions. You may, however, want to consider generating a png graphics with (say) matlab and overlay a pgfplots axis with\addplot graphics. This reduces both typesetting time + pdf size. – Christian Feuersänger Mar 30 '12 at 15:04\addplot graphics, am i suppose to writegraphicsinstead oftable? – Eagle Mar 30 '12 at 15:36\addplot graphicsto use an external image in the plot. This is a very sensible approach for applications like this, since there's nothing to be gained from having a vector version of a gridded plot, quite contrary: As the PDF Herbert linked to demonstrates, vector versions of such plots become very large and unwieldy. – Jake Mar 30 '12 at 15:57