www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/VaryCircleColorExample.m

    %% Vary Circle Color
% Create a scatter plot and vary the circle color. 

% Copyright 2015 The MathWorks, Inc.


x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
c = linspace(1,10,length(x));
scatter(x,y,[],c)
%% 
% Corresponding elements in |x|, |y|, and |c| determine the location and 
% color of each circle. The |scatter| function maps the elements in |c| to colors 
% in the current colormap.