Conditionally Colored Plot (CCPLOT)

version (1.61 KB) by Michael Heidingsfeld
Plots conditionally colored (2D line) graphs.


Updated 6 Aug 2012

View License

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.

x = linspace(0,4*pi,50);
y = sin(x);
c = y.^2;
map = colormap(jet);
h = ccplot(x,y,c,map);

Cite As

Michael Heidingsfeld (2022). Conditionally Colored Plot (CCPLOT) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Conditionally colored line plot

Community Treasure Hunt

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

Start Hunting!