Is 2d colormap supported by matlab?
Show older comments
Generally in matlab we use 1D gradient colormap as

How do we use colormap like this

6 Comments
Stephen23
on 28 Aug 2017
A 2D "colormap" is called an "image".
Ray Lee
on 28 Aug 2017
Image Analyst
on 28 Aug 2017
Your indexed or grayscale image has a single value (per pixel). This value is then used as an index into a 1-D colormap to basically turn a gray scale value into a color. If your colormap has two dimensions, then exactly what would you use as indexes to pick the color from your 2-D colormap? Of course the gray level will be one index, but what would you use as the second index? All you have is the graylevel, which can be used to select the column to use from your 2-D colormap, unless you're supplying some other attribute to select the row of your 21-D colormap.
Ray Lee
on 28 Aug 2017
@Ray Lee: as an aside, you really really should avoid using the awful JET/RAINBOW colormap. The reasons have been discussed in detail on the internet, and also here:
The new default colormap parula is a significant improvement, and you can also find other colormaps on FEX, ready for you to download:
Accepted Answer
More Answers (0)
Categories
Find more on 颜色图 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!