I have to create a carpet plot (or raster plot) with MATLAB. This plot represents the hourly electric consumption along a year.
In my actual implementation I have a m x n matrix (m is the hours in a day, n the days in a year) containing the consumption values. In order to obtain the carpet plot I use the surf function setting view(0,-90) .
The problem is that MATLAB represent each “cell” of the surface with a color that is related with the interpolation of the 4 consumption values around that “cell”, whereas I need that each cell of the surface represent a single value of the matrix.
Is there a way to obtain, with MATLAB, what I need?
surfis for making 3-dimensional surface plots.You want a 2-dimensional heat map – try looking at the output from
help imagescandhelp image.