% M-Script to test the function to
% generate simple graphics.
% This shows a figure with simultaneous
% Contrast and successive contrast
% effect
%
% Authors: Borgo, Soranzo, Grassi
% Date: 2009

figure; hold on;
colormap(gray(255));                    % Set Colormap
fill([0,4,4,0],[0,0,3,3],30);           % plot
fill([1,3,3,1],[1,1,2,2],170);          % different
fill([0,4,4,0],[3,3,6,6],200);          % color
H=fill([1,3,3,1],[4,4,5,5],170);        % rectangles
set(H,'EdgeAlpha',0);                   % Clean last rectangle edge

Npoint=30;                              % Number of points
x=[1:Npoint]./Npoint*2*pi;              % to plot a circumference.

figure;
subplot(2,1,1); hold on;
fill([0,4,4,0],[0,0,2,2],[0 0 0]);      % Plot a black rectangle
fill(sin(x)+1,cos(x)+1,'r');            % plot a red circle centered in
                                        % x=1,y=1

fill(sin(x)*0.1+1,cos(x)*0.1+1,'k');    % plot a little black circle
fill(sin(x)+3,cos(x)+1,'g');            % plot a green circle
fill(sin(x)*0.1+3,cos(x)*0.1+1,'k');
axis off;
subplot(2,1,2); hold on;
fill([0,4,4,0],[0,0,2,2],[0 0 0]);
fill(sin(x)+1,cos(x)+1,'y');
fill(sin(x)*0.1+1,cos(x)*0.1+1,'k');
fill(sin(x)+3,cos(x)+1,'y');
fill(sin(x)*0.1+3,cos(x)*0.1+1,'k');
axis off;