plot_color(X, Y, P, ColorStart, ColorEnd, MarkerSize)

function plot_color(X, Y, P, ColorStart, ColorEnd, MarkerSize)
%PLOT_COLOR
% PLOT_COLOR draws a bidimensional dotted graph, where the color of every
% single point of the vectors X, Y depends by vector P (the intensity
% color, isn't necessary normalize it).
% X, Y and P must be vector and must be have same lenght.
% ColorStart and ColorEnd are the two colours that specifying the
% fractional position of blending. P determines the point to point
% percent of colour.
% MarkerSize has the same sintax as when using it in the plot.
%
% BLENDCOLOR.M file required.
% See: www.mathworks.com/matlabcentral/fileexchange/41691blendcolor
%
%
% Author(s): G. Alessandroni, 051113
% Copyright 2013, University of Urbino
%
% Rows of lat vector
[n ~] = size(X);
% Normalized power vector
P = Pmin(P);
Pn = P/max(P);
% Plot graphics
hold on
for i=1:n
C = blendcolor(ColorStart, ColorEnd, Pn(i));
plot(X(i), Y(i), '.', 'color', C, 'MarkerSize', MarkerSize);
end
hold off
end
% [EOF]  PLOT_COLOR.M

