% EXTRA DEMO:   THE POWERS OF THE PLOT COMMAND
%
% Program:      rainbow_simple.m
% Written by:   
% For:          EE 311
%               Extra Demo Computer Lab 1
% Date:         7-3-2001
% Purpose:      This program plots a rainbow
%               using straight lines
%               This only demonstrates the use
%               of colors when using the plot command
clear all, close all
j=sqrt(-1);
theta=0:(pi/2)/100:pi/2;    % A quarter of a circle
arc=exp(j*theta);
% radiuses of the various arcs
rr=0.775;, sr=rr*arc;       % Red arc
ry=0.75;,  sy=ry*arc;       % Yellow arc
rg=0.725;, sg=rg*arc;       % Green arc
rc=0.7;,   sc=rc*arc;       % Cyan arc
rb=0.675;, sb=rb*arc;       % Blue arc
rm=0.65;,  sm=rm*arc;       % Magenta arc

figure
hold on
% Print out a rainbow using regular lines
plot(real(sm),imag(sm),'-m',real(sb),imag(sb),'-b')
plot(real(sc),imag(sc),'-c',real(sg),imag(sg),'-g')
plot(real(sy),imag(sy),'-y',real(sr),imag(sr),'-r')
axis square
title('Simple Rainbow Demo')
xlabel('real part'), ylabel('imag part')