CMAPLINE

apply a colormap to lines in a plot
2,4K téléchargements
Mise à jour 29 oct. 2008

Afficher la licence

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')

Citation pour cette source

Andrew Stevens (2025). CMAPLINE (https://www.mathworks.com/matlabcentral/fileexchange/21102-cmapline), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2008a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Color and Styling dans Help Center et MATLAB Answers
Remerciements

Inspiré par : varycolor

A inspiré : 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!
Version Publié le Notes de version
1.2.0.0

updated help so that the example will run properly, description