How to represent each entry of a matrix by its own box with matlab
2 views (last 30 days)
Show older comments
Hey everybody I want to know if is possible to make a pcolor plot where the color values isn't stored on the edges of the boxes of all the little box but rather the middle of the little box. Right now I create my mesh with
x=0:50;
y=0:50;
[X,Y]=meshgrid(x,y);
and my figure with
figure
main=pcolor(X,Y,feldAIC);
colormap(cmap)
caxis([0 1]);
xlim([0 50]);
ylim([0 50]);
where cmap is my personal colormap vector and feldAIC is my matrix of the size [size(x),size(y)]. The result looks something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158563/image.jpeg)
but the shown colors must be some kind of interpolation between the four values on the corners of each little box. I would like to have something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158564/image.jpeg)
where each of my entry in my matrix feldAIC is represented by its own box and the color of the box is calculated by only the value of this entry.
So is there a way to make sure each entry is represented by its own box, rather then having each box be a interpolation of 4 entries.
4 Comments
Accepted Answer
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!