% EXTRA DEMO:   THE POWERS OF THE PLOT COMMAND
%
% Program:      rainbow_arch.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 lines:
%               axis equal, axis normal, and axis([-1 1 0 1.5])
%               are commented out. Remove the % sign from
%               in front of each command in the order that they 
%               are listed. Re-run the program to see what happens 
%               each time. Which do you like the best?
%               Un-comment the colordef black command to see the
%               graphs better.
clear all, clf reset, close all 
% colordef black

j=sqrt(-1);
theta=0:pi/100:pi;          % A semicircle
arch=exp(j*theta);
% radiuses of the various arcs
rr=0.775;, sr=rr*arch;      % Red arc
ry=0.75;,  sy=ry*arch;      % Yellow arc
rg=0.725;, sg=rg*arch;      % Green arc
rc=0.7;,   sc=rc*arch;      % Cyan arc
rb=0.675;, sb=rb*arch;      % Blue arc
rm=0.65;,  sm=rm*arch;      % Magenta arc

hold on

% Plot a full arch using the fancy output method
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 equal
% axis normal
% axis ([-1 1 0 1.5])
title('Full Rainbow Demo')
xlabel('real part'), ylabel('imag part')

% Note: The 'text' argument for each individual plot commmand
% is called the line specification (linespec in the MATLAB
% help files). You will notice in the last plot command,
% where the yellow x's and red o's are ploted, that these
% symbols are not connected by lines. You can connect these
% by changing the line specification from 'xy' to '-xy' and
% 'or' to '-or'. Each line specification can contain up to 
% three arguments (such as '-or'). For more information look
% up the plot command in the MATLAB help files. This is 
% important for one of the modules 