O'Reilly logo

Sams Teach Yourself Perl in 21 Days, Second Edition by Rafe Colburn, Laura Lemay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Statistics with a Better Histogram

Here's yet another version of the statistics program we've been working with throughout the last week. Yesterday's version of the statistics program included a horizontal histogram that looked like this:

Frequency of Values:
1  | *****
2  | *************
3  | *******************
4  | ****************
5  | ***********
6  | ****
43 | *
62 | *

For this version, we'll print a vertical histogram that looks like this:

 †††††* †††††* †††††* †††††* †††††* †††††*†* †††††*†*†* †††††*†*†*†††††††*†††††*†††††* †††††*†*†*†††*†*†*†††††*†††††* †††*†*†*†*†††*†*†*†††††*†††††* †††*†*†*†*†††*†*†*†††††*†††††* †*†*†*†*†*†*†*†*†*†††††*†††††*††* †*†*†*†*†*†*†*†*†*††*††*††*††*††*††*††* --------------------------------------- †1†2†3†4†5†6†7†8†9†12†23†25†34†37†39†42 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required