G'day programmingzeal,
I've provided some code below; it's in three parts; I don't know how much will be useful for you.
#!/usr/bin/env perl use strict; use warnings; use List::Util qw{min max}; # Built-in functions my @values = (7,9,2,0,1,2,4,3,9); print 'Min: ', min(@values), "\n"; print 'Max: ', max(@values), "\n"; print 'Count: ', 0+@values, "\n"; # How to get from (0,0) at top left to bottom left my @matrix = ( [' ' x 2, '*', ' ' x 2], [' ', '*', ' ', '*', ' '], ['*', ' ' x 3, '*'], ); print "\nOriginal:\n"; for (0 .. $#matrix) { print @{$matrix[$_]}, "\n"; } print "\nInverted:\n"; for (reverse 0 .. $#matrix) { print @{$matrix[$_]}, "\n"; } # A complete guess about your graph my @graph; for (0 .. max(@values)) { $graph[$_] = [(' ') x @values]; } for my $i (0 .. $#values) { $graph[$values[$i]][$i] = '*'; } print "\nGraph:\n"; for (reverse 0 .. $#graph) { print @{$graph[$_]}, "\n"; }
Output:
Min: 0 Max: 9 Count: 9 Original: * * * * * Inverted: * * * * * Graph: * * * * * * * * *
For future reference, please avoid unnecessary verbiage: trips down Memory Lane ("I recall my initial programming assignments in Java ..."); merisms ("Pyramid, Square, Rectangle, Circle"); and other irrelevances. Your code has inclusions that are never used: Data::Dumper, $XAxis_LMSE; while missing important parts, such as a print statement. A bit of ASCII art, to demonstrate the type of output you wanted, would have helped greatly.
— Ken
In reply to Re: Plot Graph in Console by printing special character say * and spaces using matrix structure in Perl
by kcott
in thread Plot Graph in Console by printing special character say * and spaces using matrix structure in Perl
by programmingzeal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |