LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2010, 11:20 AM   #1
zeratul111
LQ Newbie
 
Registered: Sep 2010
Posts: 19

Rep: Reputation: Disabled
stem-and-leaf plot in perl?


Hi forum,

I'm curious if anyone know how to plot stem-and-leaf plot using perl?

Basically, what I was wanting to do is read a bunch of numbers from a text file into an array, sort from smallest to biggest, and plot the following (last digit serves as the "leaf", so for example, for the following graph, going down from top to bottom is 7, 7, 12, 13, 18, 18, 23, 25, 27, 27, 27, 27, 27, 27, 28, 28, 29, 59, 30, 31, 31 etc.):

Quote:
0 | 7 7
1 | 2 3 8 8
2 | 3 5 7 7 7 7 7 7 8 8 9 9
3 | 0 1 1 1 1 2 3 4 5 6 7 7 7 8 9
4 | 0 0 1 2 2 2 2 3 3 3 4 4 4 5 6 7 8 8
5 | 2 3 7 8 8
6 | 1 3 8
7 | 1
8 |
9 | 6 9
10 | 4 5 5 5 5 6 7 9 9 9
11 | 1 3 3 3 3 4 4 4 5 5 5 6 6 6 6 7 7 7 7 8 8 9 9
12 | 0 0 1 1 2 2 3 4 4 4 5 5 5 6 7 7 7 7 8 8
13 | 1 2 3 9
14 | 1 6
I found the following script: http://rosettacode.org/wiki/Stem-and-leaf_plot#Perl_6 But this doesn't work. On that page, there's also "Perl generating LaTeX"??

The version of Perl I'm using is v5.8.8 built for x86_64.

Thanks!
 
Old 11-11-2010, 11:29 AM   #2
udaman
Member
 
Registered: Oct 2010
Location: New England, USA
Distribution: OpenSUSE/Slackware64/RHEL/Mythbuntu
Posts: 187

Rep: Reputation: 39
Please don't expect anyone here to write your program for you. We'll be happy to help you write it.

What is the error from the program in the link you've supplied, and what is your recommendation to fix it? Can you post the code you've written, use code tags, so we can help find your errors?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] List non-mandatory leaf packages [CentOS 5.4] carbonfiber Red Hat 2 02-21-2010 04:39 AM
Which version of LEAF is the best for my situation? camper365 Linux - Server 0 04-19-2009 05:29 PM
Linux and leaf drivers? halturata Programming 1 07-12-2007 10:29 AM
LRP/LEAF Howto erat123 Linux - Software 1 01-12-2007 01:09 AM
How to be a leaf node of an IRC network ? freelinuxcpp Linux - Networking 2 08-04-2004 10:14 AM


All times are GMT -5. The time now is 10:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration