CMAPLINE

版本 1.2.0.0 (2.5 KB) 作者: Andrew Stevens
apply a colormap to lines in a plot
2.4K 次下载
更新时间 2008/10/29

查看许可证

CMAPLINE finds all lines in an axis and specifies their colors according to a colormap. Also accepts custom colormaps in the form of a n x 3 matrix.

EXAMPLE (generates screenshot)

%generate some data
x=(0:0.1:2*pi);
m=50; exdata=bsxfun(@plus,repmat(25.*sin(x),...
[m 1]),[1:m]');

figure
subplot(121);
plot(x,exdata,'o-','linewidth',2)
cmapline('colormap','jet');
set(gca,'color','k')
title('jet colormap')

subplot(122);
plot(x,exdata,'o-','linewidth',2)
custommap=flipud(hot);
cmapline('colormap',custommap,'filled')
set(gca,'color','k')
title('reverse hot colormap, filled markers')

引用格式

Andrew Stevens (2024). CMAPLINE (https://www.mathworks.com/matlabcentral/fileexchange/21102-cmapline), MATLAB Central File Exchange. 检索来源 .

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

参考作品: varycolor

启发作品: COLORMAP and COLORBAR utilities (Jul 2014)

Community Treasure Hunt

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

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

updated help so that the example will run properly, description