% EXTRA DEMO:   THE POWERS OF THE PLOT COMMAND
%
% Program:      rainbow_fancy.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 demonstrates the use of colors
%               and symbols when using the plot command
% Extra:        Notice that the line colordef black is 
%               commented out. Remove the % sign from
%               in front of the command. Re-run the 
%               program to see what happens. Can you 
%               figure out how to change it back
clear all, clf reset, close all 
% colordef black

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

hold on
% Print out the same rainbow, execpt use symbols to 
% plot each part of the rainbow
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),'xy',real(sr),imag(sr),'or')
axis square
title('Fancy Rainbow Demo')
xlabel('real part'), ylabel('imag part')