how to display elements of a 2D matrix as color-coded squares

 Accepted Answer

imagesc(your_matrix)

2 Comments

Or use imshow() (if you have the Image Processing Toolbox) and apply a colormap (of which there are a wide variety of colormaps built in to MATLAB). But whatever you do, don't use pcolor() for this purpose.

Sign in to comment.

More Answers (1)

What if I want to plot it into a map with longitude and Latitude axes??

Categories

Tags

Asked:

A
A
on 27 May 2012

Answered:

on 29 Dec 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!