I'm using matlab2tikz to export imagesc figures into TikZ/pgfplots code. This process gives me a TikZ file and a rasterized png version of the image with colours matching the colourbar at the time of execution.
The problem is that the resulting image is upside-down and displays a blurred colormap, as shown below.
This is the tikzpicture:
while this is how it should look like (screenshot from Matlab R2013a):
The file produced by matlab2tikz is as follows
\begin{tikzpicture}
\begin{axis}[%
width=5.296in,
height=4.747in,
at={(1.01in,0.641in)},
scale only axis,
point meta min=1,
point meta max=8.715,
axis on top,
separate axis lines,
every outer x axis line/.append style={black},
every x tick label/.append style={font=\color{black}},
xmin=0.05,
xmax=1.05,
every outer y axis line/.append style={black},
every y tick label/.append style={font=\color{black}},
y dir=reverse,
ymin=0.05,
ymax=1.05,
axis background/.style={fill=white},
colormap/jet,
colorbar,
colorbar style={separate axis lines,every outer x axis line/.append style={black},every x tick label/.append style={font=\color{black}},every outer y axis line/.append style={black},every y tick label/.append style={font=\color{black}}}
]
\addplot [forget plot] graphics [xmin=1.05,xmax=0.05,ymin=1.05,ymax=0.05] {ainf-1.png};
\end{axis}
\end{tikzpicture}%
while the Matlab code that generates the figure is
figure
imagesc([1 0.1], [1 0.1], mean_e_range)
colorbar
My primary concern is how to sharpen the blurred surface of the colormap. As for the other problem, at worst I can plot the upside-down figure in Matlab and then get the upside-down TikZ version of such upside-down figure, which is the final picture I want.


matlab2tikzsince that script generates the bitmap graphics in question. – Christian Feuersänger Jan 15 '16 at 18:37mean_e_rangeinto\addplot[matrix plot]as outlined in the linked answer. Section "7.2.1 Importing Mesh Data From Matlab To PGFPlots" of thepgfplotsmanual shows how to export + import the data. – Christian Feuersänger Jan 15 '16 at 18:39matlab2tikz. I had read the answer you linked to before posting my question, but without realising it could be useful to solve my problem. – AAG Jan 16 '16 at 18:18