Conditionally Colored Plot (CCPLOT)
Version 1.1.0.0 (1.61 KB) by
Michael Heidingsfeld
Plots conditionally colored (2D line) graphs.
Plots the vector Y versus vector X using conditional coloring based on colormaps.
The condition vector C is independent of the values of X and Y but must be the same size.
The colormap MAP can either be a Matlab or a userdefined colormap.
Example:
x = linspace(0,4*pi,50);
y = sin(x);
c = y.^2;
map = colormap(jet);
h = ccplot(x,y,c,map);
set(h,'Marker','o');
Cite As
Michael Heidingsfeld (2026). Conditionally Colored Plot (CCPLOT) (https://www.mathworks.com/matlabcentral/fileexchange/37725-conditionally-colored-plot-ccplot), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2010b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Color and Styling in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired by: Conditionally colored line plot
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
