title: Print graph into terminal. Perl
body: <p>I just found the GD::Graph module, but it prints graph into file. </p>
  
  <p>I want to create a kind of a monitor which prints on to terminal. </p>
  
  <p><strong>For example how could i print a graph (not exactly, but similar so it fits to terminal) like this onto a terminal?</strong></p>
  
  <p><strong>Updated</strong></p>
  
  <pre><code>use strict;
  use GD::Graph::bars;
  use GD::Graph::hbars;
  use GD::Graph::Data;
  require 'save.pl';
  
  my $data = GD::Graph::Data-&gt;new([
      ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
      [    1,    2,    5,    6,    3,  1.5,    1,     3,     4],
  ]) or die GD::Graph::Data-&gt;error;
  
  my @names = qw/sample11 sample11-h/;
  
  for my $my_graph (GD::Graph::bars-&gt;new, GD::Graph::hbars-&gt;new)
  {
      my $name = shift @names;
  
      print STDERR "Processing $name\n";
  
      $my_graph-&gt;set(
          x_label         =&gt; 'X Label',
          y_label         =&gt; 'Y label',
          title           =&gt; 'A Simple Bar Chart',
          #y_max_value     =&gt; 8,
          #y_tick_number   =&gt; 8,
          #y_label_skip    =&gt; 2,
  
          #x_labels_vertical =&gt; 1,
  
          # shadows
          bar_spacing     =&gt; 8,
          shadow_depth    =&gt; 4,
          shadowclr       =&gt; 'dred',
  
          transparent     =&gt; 0,
      )
      or warn $my_graph-&gt;error;
  
      $my_graph-&gt;plot($data) or die $my_graph-&gt;error;
      save_chart($my_graph, $name);
  }
  </code></pre>