Custom Colormap

This function is able to define a customized colormap given the positions and the colors that are required to make the gradients.
7.2K 次下载
更新时间 2019/9/11

查看许可证

The function defines a customized colobar given the positions and the colors that are going to generate the gradients. A Live Script example is also provided to understand the following parameters:

- positions: Vector of positions, from 0 to 1. Note that the first position must be 0, and the last one must be 1.

- colors: Colors to place in each position. This parameter can be specified as a RGB matrix (n_colors x 3), or as a cell vector, containing HTML values. For instance: {'#ffffff','#ff0000','#000000'} is equivalent to [1 1 1; 1 0 0; 0 0 0].

*Update*: The function customcolormap_preset provides 8 new cool presets in order to save time configuring your own!. The presets are 'pasteljet', 'red-yellow-blue', 'red-yellow-green', 'red-white-blue', 'orange-white-purple', 'purple-white-green', 'pink-white-green', 'brown-white-pool'.

Example of use:
J = customcolormap([0 0.5 1], {'#ffffff','#ff0000','#000000'});
colorbar; colormap(J); axis off;

引用格式

Víctor Martínez-Cagigal (2024). Custom Colormap (https://www.mathworks.com/matlabcentral/fileexchange/69470-custom-colormap), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2018b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1

Presets are now available.

1.0.0