multigradient: custom gradient colormap

버전 1.5.6 (46.3 KB) 작성자: Laurens R Krol
An adjustable multiple-colour gradient colour map generator / editor for MATLAB, with presets.
다운로드 수: 637
업데이트 날짜: 2021/1/12

This script allows you to generate a colour scale (as for colormap, colorbar) using any number of custom colours, and allows you to arrange these colours by adjusting their relative positions with respect to each other, much like you may be used to creating gradients in e.g. Adobe Photoshop or CorelDRAW. It will automatically interpolate the colours in between the indicated anchor points.

In its most basic form, simply call the script using an n-by-3 matrix of RGB values, and it will generate the colour map accordingly. For example, multigradient([1 0 0; 1 1 0; 0 1 0]) will return a map that blends from red through yellow to green, of the same size as the current figure's color map. Further tricks are optional. Note that some of these tricks use the Image Processing Toolbox, specifically the rgb2lab and lab2rgb functions.

* Interpolation in RGB space. Simple linear interpolation of the given RGB values.
* Interpolation in HSV space. Linear interpolation of the values after conversion into HSV, for e.g. the rainbow colormap: multigradient([1 0 0; 0 0 1], 'interp', 'hsv').
* Isoluminant interpolation in L*a*b* space. The L* value is equalised for all given colours before linear interpolation and conversion back to RGB. Note that some colour clipping may occur due to the gamut differences.
* Interpolation in Kenneth Moreland's Msh space for divergent colour maps for scientific visualisation. A neutral unsatured middle point is automatically inserted if the two endpoint colours for the diverging map are sufficiently distinct. See: Moreland, K. (2009). Diverging color maps for scientific visualization. In Proceedings of the 5th International Symposium on Visual Computing, doi: 10.1007/978-3-642-10520-3_9 mirrored at https://www.kennethmoreland.com/color-maps/ColorMapsExpanded.pdf
* Control points allow the relative distances between the colours to be adjusted.
* Many presets, including colour scales designed by Kenneth Moreland (https://www.kennethmoreland.com) and Cynthia Brewer (http://colorbrewer2.org), are included.
* Colour scales can easily be reversed.

인용 양식

Laurens R Krol (2024). multigradient: custom gradient colormap (https://github.com/lrkrol/multigradient), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.5.6

Updated sample.m and description following Vittorio Picco's comment.

1.5.5

- Fixed typo in preset seq.cb.YlGnBu name
- Added preset: div.RdYlGn

1.5.3

- Updated preset naming convention
- Reversed div.cm colours to maintain cold -> warm consistency
- Code clean-up

1.5.0

- Added L*a*b* isoluminant interpolation (labiso)
- Added Msh divergent interpolation (mshdiv)
- Added preset argument with some initial presets
- Added reverse argument
- Enabled middle control point for two-colour maps

1.0.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.