Colors for plotting

버전 1.0.0.0 (1.09 KB) 작성자: Giorgos
Provides color variation for line plots.
다운로드 수: 789
업데이트 날짜: 2013/9/18

라이선스 보기

For multiple plots on the same figure, current color schemes are often not satisfactory. This function provides a smooth transition from red, through green, to blue. The function is especially suited for visualisation of the dependence of a variable over small variations of a parameter.

The following two ways can be used to reproduce the screenshot:

Color definition:
N = 50;
ColorSet = ColorBand(N);

Some data:
x = zeros(N, 2);
y = zeros(N, 2);
x(:,2) = N:-1:1;
y(:,2) = 1:N;

a) Separately set the color of each plot:
figure
hold on
for m = 1:N
plot(x(m,:), y(m,:), 'color', ColorSet(m,:));
end

b) Manually set the color order:
figure
hold all
set(gca, 'ColorOrder', ColorSet);
for m = 1:N
plot(x(m,:), y(m,:));
end

Special thanks to Jiro for the construction of a visually appealing example. See his blog on http://blogs.mathworks.com/pick/2008/08/15/colors-for-your-multi-line-plots/

인용 양식

Giorgos (2025). Colors for plotting (https://www.mathworks.com/matlabcentral/fileexchange/43548-colors-for-plotting), MATLAB Central File Exchange. 검색 날짜: .

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

도움 받은 파일: varycolor

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0