function genealogy_tree ( )

%*****************************************************************************80
%
%% genealogy_tree makes a tree plot of a genealogy.
%
%  Discussion:
%
%    MATLAB's "treeplot" function is very limited.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    08 October 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'genealogy_tree:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Plot a tree illustrating a genealogy.\n' );
%
%  Each entry in "nodes" is the "parent" of the given node.
%
  nodes = [ 0, 1, 2, 2, 4, 4, 4, 1, 8, 8, 10, 10 ];
%
%  Display the basic tree.
%
  treeplot ( nodes, 'r*', 'b--'  );
%
%  Assign labels for each node.
%
  labels = { ...
    'George',
    'Martha',
    'Allen',
    'Samantha',
    'Karen',
    'Dennis',
    'Mohit',
    'Cecilie',
    'Aram',
    'Naomi',
    'Otto',
    'Francine' };
%
%  Get the coordinates of each node.
%
  [ x, y ] = treelayout ( nodes );
%
%  Plot the labels at the nodes.
%
  for i = 1 : length ( x )
    text ( x(i), y(i), labels{i} );
  end

  title ( 'Genealogy tree' );
  filename = 'genealogy_tree.png';
  print ( '-dpng', filename );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'LAB03_8:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end


