Build Custom Colormaps with Variable Resolutions

Build custom colormaps
Updated 2 Sep 2014

View License

This function can be used to build your own custom colormaps.
the first input argument colors is a n X 3 matrix with each row
specifying the color.
the second argument is the resolution of the colormap default(300)
colors_mat = [1 0 1; 0 1 0];
% % try the output cmap:
imshow(im), colorbar
colormap(cmap) %will use the output colormap

Author: Vengatesan G
Thanks to M Sohrabinia for his original work.

Cite As

Vengatesan (2024). Build Custom Colormaps with Variable Resolutions (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Changed the title.