Code covered by the BSD License  

Highlights from
timeline

image thumbnail
from timeline by Iari-Gabriel Marino
Graphical visualization of chronological timelines

timeline(list)
function timeline(list)
% TIMELINE   Graphical visualization of timelines
% 
% Script for graphical visualization of chronological timelines
% of people, events, ecc.
% 
% Create your own list and pass it to the function as argument
% (see the example inside by using the edit command).
% 
% ----------------------------------------------------------
% (c) 2006  Iari-Gabriel Marino 
%           <iarigabriel.marino@fis.unipr.it>
%           http://www.fis.unipr.it/home/marino/
% Upgraded by:
%           Jrme
%           <dutmatlab@yahoo.fr>
% ----------------------------------------------------------

if nargin==0
    
list = {
        'Pitagora' [-575 -490]
        'Socrate' [-470 -399]
        'Platone' [-427 -347]
        'Aristotele' [-384 -322]
        'Eschilo' [-525 -456]
        'Sofocle' [-497 -406]
        'Euripide' [-480 -406]
        'Cicerone' [-106 -43]
        'Aurelio Agostino' [354 430]
        'Roger Bacon' [1214 1294]
        'Raimondo Lullo' [1235 1315]
        'Alberto Magno' [1193 1280]
        'Tommaso d''Aquino' [1224 1274]
        'Dante Alighieri' [1265 1321]
        'Tritemio' [1462 1516]
        'Cornelio Agrippa' [1486 1535]
        'Leonardo da Vinci' [1452 1519]
        'Giulio Camillo' [1480 1544]
        'Paracelso' [1493 1541]
        'Erasmo da Rotterdam' [1469 1536]
        'Nostradamus' [1503 1566]
        'Giordano Bruno' [1548 1600]
        'Francis Bacon' [1561 1626]
        'Shakespeare' [1564 1616]
        'Comenius' [1592 1670]
        'Robert Fludd' [1574 1637]
        'Descartes' [1596 1650]
        'Caravaggio' [1571 1610]
        'Isaac Newton' [1642 1727]
        'Leibniz' [1646 1716]
        'Immanuel Kant' [1724 1804]
        'Bach' [1685 1750]
        'Goethe' [1749 1832]
        'Mozart' [1756 1791]
        'Beethoven' [1770 1827]
        'Victor Hugo' [1802 1885]
        'Friedrich Nietzsche' [1844 1900]
        'Friedrich Hegel' [1770 1831]
        'F. M. Dostoevskij' [1821 1881]
        'Stendhal' [1783 1842]
        'Marcel Proust' [1871 1922]
        };
        
elseif ~iscell(list) 
        
    error('Input argument must be a cell array');
    
end

% chronological ordering by birthday
temp=reshape([list{:,2}],2,[])';
[temp,idx]=sortrows(temp);

n_idx=numel(idx);

% Create data for PATCH object
x=[temp temp(:,[2 1])]';
y=[1:n_idx;1:n_idx;[1:n_idx]+1;[1:n_idx]+1];

figure

% Create color fo PATCH
C=jet(n_idx);
% Use PATCH and TEXT only one time.
patch(x,y,reshape(C,1,n_idx,[]))
text(x(2,:)+5,y(1,:)+0.5,list(idx,1),'fontsize',10)

xlabel('Time (years)')  
grid

Contact us at files@mathworks.com