4.0 | 1 rating Rate this file 12 Downloads (last 30 days) File Size: 1.61 KB File ID: #37725 Version: 1.1
image thumbnail

Conditionally Colored Plot (CCPLOT)



03 Aug 2012 (Updated )

Plots conditionally colored (2D line) graphs.

| Watch this File

File Information

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


Conditionally Colored Line Plot inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.11.1 (R2010bSP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
16 Mar 2015 John Hutchison

minor issue, either the >= or <= on line 32 must have the = removed to avoid omitting segments with endpoints on colormap transition points. See the segment between the 6th and 7th points in the example plot

Comment only
14 Feb 2013 JR King

JR King (view profile)

Thanks. It would be nice however to allow multiple line plotting such as: ccplot(1:10,rand(200,10),c,map)

06 Aug 2012 1.1

* Fixed minor error in example

Contact us