CubeHelix Colormap Generator: Beautiful and Versatile!

버전 2.3.4 (14.4 KB) 작성자: Stephen23
A versatile implementation of the CubeHelix algorithm to create colormaps (suitable for grayscale conversion)
다운로드 수: 4.4K
업데이트 날짜: 2024/1/15
CUBEHELIX generates colormaps for published or distributed documents as they are very attractive in full color and yet are suitable for grayscale conversion.
CUBEHELIX creates different colormaps using just a few parameters. The standard algorithm offer very attractive colorschemes for online and electronic documents (e.g. PDF), and yet when printed in grayscale they keep exactly the sequence information of the original data. CUBEHELIX function also includes two extra controls over the range and domain of the colormap values, giving an unlimited number of colormaps with many different styles: spectral, multi hue, single hue, or even simple grayscale.
Algorithm
CUBEHELIX colorschemes consist of nodes along a tapered helix in the RGB color cube, with a continuous increase in perceived intensity (e.g. black->white). Thus the scheme defines attractive colormaps with a huge choice of hue, saturation and brightness, and yet printing a figure (or image) in Black-and-White (e.g. postscript) results in a monotonically increasing grayscale that retains the brightness order of the original colormap. The sequence information of the colormap is retained even in grayscale, which means an attractive colored image can be printed in grayscale and still be informative to the end-user.
The CUBEHELIX algorithm is defined here:
Examples
% New colors for the COLORMAP example:
S = load('spine');
image(S.X)
colormap(cubehelix) % default parameters
% New colors for the SURF example:
[X,Y,Z] = peaks(30);
surfc(X,Y,Z)
colormap(cubehelix([],0.5,-1.5,1,1,[0.29,0.92]))
axis([-3,3,-3,3,-10,5])
Bonus Function
CUBEHELIX_VIEW creates an interactive figure that allows selection of the colorscheme, and that contains two colorbars showing colors of the colormap and the grayscale equivalent.
R2014b or later: CUBEHELIX_VIEW can also update other axes' or figures' colormaps in real time, for example:
S = load('spine');
image(S.X)
cubehelix_view(gca)
Notes
  • The original specification (given in the links above) misnamed the saturation option as "hue". In the CUBEHELIX function the saturation option is named "satn".

인용 양식

Stephen23 (2024). CubeHelix Colormap Generator: Beautiful and Versatile! (https://github.com/DrosteEffect/CubeHelix/releases/tag/2.3.4), GitHub. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2010b
R2009b 이상 릴리스와 호환
플랫폼 호환성
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!

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

버전 게시됨 릴리스 정보
2.3.4

See release notes for this release on GitHub: https://github.com/DrosteEffect/CubeHelix/releases/tag/2.3.4

2.3.3

See release notes for this release on GitHub: https://github.com/DrosteEffect/CubeHelix/releases/tag/2.3.3

2.3.2

See release notes for this release on GitHub: https://github.com/DrosteEffect/CubeHelix/releases/tag/2.3.2

2.3.1

See release notes for this release on GitHub: https://github.com/DrosteEffect/CubeHelix/releases/tag/2.3.1

2.3.0

* default size to suit HG2.
* improve error messages.
* include PRESET_COLORMAP
* remove CUBEHELIX_FIND

2.2.0

* Add error IDs.
* Improve input checking.

2.1.0.1

* Simplfiy CUBEHELIX_VIEW figure creation.

2.1.0.0

* Replace that awful automatically-generated title with the original title.
* Update FEX blurb.

2.0.0.0

* Move to GitHub repository.
Changes to "cubehelix_view":
* Simplify internal graphics-handle management.
* Simplify figure layout.

1.8.0.0

* Minor edit to blurb, consistent parameter names.

1.7.0.0

* Use correct color terminology: rename "hue" -> "sat", and "start" -> "hue".

1.6.0.0

* Change input name from <rng> to <yrange> to avoid conflict with inbuilt function.
* Simplify input checking.
* Simplify internal passing of variables to local functions.

1.5.0.0

* Include Domain option.
* Include 3D RGB-cube viewer.
* More robust parameter finder.

1.4.0.0

- Improve input argument checking.

1.3.0.0

- Improve input argument checking.
- Viewer figure now displays warnings for clipped RGB or non-monotonic grayscale values.
- Demo now also varies the range values.

1.2.0.0

- Allow parameters to be input as a vector.
- Improve viewer background.
- Better demonstration-mode: random examples in the viewer.

1.1.0.0

- Add range sliders to viewer.
- Slightly robuster finder algorithm.
- Show some nice examples in the illustration!

1.0.0.0

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