Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Perl Programming

Data Visualization using Perl/Tk 14

Idean writes "Generating a visual representation is often the best way to understand large data sets, but standard tools such as gnuplot often fall short. This article shows how to use Perl/Tk, the standard GUI toolkit for Perl, to quickly build custom plotting and graphing tools."
This discussion has been archived. No new comments can be posted.

Data Visualization using Perl/Tk

Comments Filter:
  • Perl/Tk. Because Perl wasn't cryptic enough. :)

    I know, mod me down! But hear me out first: We played a game of "Perl or Line Noise" where lines of hand-picked valid perl (admittedly some more cryptic choices) and 7-bit chopped output from /dev/random were presented on screen. Three users had to race to punch a button first if they thought they were looking at valid perl. If it was "line noise," they had to let it time out after three seconds, just like Jack Attacks, in You Don't Know Jack.

    At the end, two

    • by Phillup ( 317168 )
      And how did your control group do?

      What language was Perl compared to using this methodology?

      Did the test subjects have experience with Perl? And, what of the control group?

      Perl is different, no doubt about it. But, it doesn't *have* to look like line noise.
    • If you're a good programmer, you can read the line noise.

      At the same time, a good perl hack wouldn't write unreadable code. I often rewrite a complex operation, breaking it into 3 or 4 step, out of courtesy to the poor schmuck who has to maintain the code.
  • This must be one the few slashdot stories that is completely on topic, and by that I mean "News for Nerds, Stuff that Matters".

    This will be a nice new toy for me in my work as a research student, Thanks!
  • by CompVisGuy ( 587118 ) on Friday September 05, 2003 @12:40PM (#6881128)
    I don't see the point in using Perl and Tk to write you own scientific plotting software. There is already plenty of software out there to do this, and it's better written and tested than anything one would produce in an afternoon with Perl and Tk.

    The last thing you need when exploring large and complex data sets is to find that the code you are using to visualise the data is buggy! Don't roll your own!

    I use Matlab for my work, and it has a fantastic range of scientific plotting features. It's not cheap, but there are some good free/OS packages too:

    Look at:

    gnuplot (http://www.gnuplot.info/)
    KMatplot (http://kmatplot.sourceforge.net/)
    GGobi (http://www.ggobi.org/)
    Gri (http://gri.sourceforge.net/)

    There are others, too.

    I do not consider the data that was used in the example to be complex or large, and I don't see how Perl could help, as numerical processing is certainly not its strength!

    Perl may be useful for massaging data into a form that is accepted by a scientific visualisation package, however.
    • by spencerogden ( 49254 ) <spencer@spencerogden.com> on Friday September 05, 2003 @01:22PM (#6881521) Homepage
      "and I don't see how Perl could help, as numerical processing is certainly not its strength!"

      Have you explored PDL (piddle)? I find it to be a very powerful way to manipulated datasets.
    • Another entry in the "good free software for plotting that is like Matlab" catagory (yes, very specific), is Octave [octave.org].

      From their web site: "GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language."

  • See also: PDL (Score:4, Informative)

    by bill_mcgonigle ( 4333 ) on Friday September 05, 2003 @01:07PM (#6881405) Homepage Journal
    I'll just copy what their homepage [perl.org] says:
    PDL ("Perl Data Language") gives standard Perl the ability to compactly store and speedily manipulate the large N-dimensional data arrays which are the bread and butter of scientific computing.


    PDL turns perl in to a free, array-oriented, numerical language similar to such commerical packages as IDL and MatLab. One can write simple perl expressions to manipulate entire numerical arrays all at once. For example, using PDL the perl variable $a can hold a 1024x1024 floating point image, it only takes 4MB of memory to store it and expressions like $a=sqrt($a)+2 manipulate the whole image in a few seconds.
    It offers both 2D [perl.org] and 3D [perl.org] visualization.
  • Statistical Data (Score:5, Interesting)

    by neglige ( 641101 ) on Friday September 05, 2003 @04:06PM (#6882997)
    Examples of complicated graphs include specialized bar-and-whiskers plots

    I had to cope with box-and-whisker plots to visualize data gathered from a statistical survey. Frankly, Perl/Tk was nothing I looked into (and I love Perl & Tk!). I entered the data into an OpenOffice spreadsheet (which made the statistical calculation very easy!) and googled for a solution. There are many commercial packages available for Excel, but this article [qualitydigest.com] was really helpful. I managed to create a similar solution for OO (I'm not sure if the result is of interest to anyone - if so, msg me or something).

    Does anyone know a repository for statistical analysis programs? Because if you only need to run an analysis once, you think twice about hacking a Perl/Tk program (the 'clean' approach) unless you are a true Perl wiz - the time needed to write the program is (with my programming abilites) two or three times longer than looking for another one shot solution (the 'practical' approach).

    If there was a central repository for this, you a) knew where to look first and b) had an incentive to write the program to save someone else the time. Yes, I know I could put it up to some website, but I really doubt anyone would find it or even look for it...
  • by penguin7of9 ( 697383 ) on Saturday September 06, 2003 @04:16AM (#6886315)
    If you want statistically sound data analysis and graphing, look no further than the R Project [r-project.org]. It's a complete programming environment and is extensively used by working statisticians.

    Python, Numerical Python, various Python plot packages, and VTK also make for very powerful visualizations if you want something more do-it-yourself.
    • If you want statistically sound data analysis and graphing, look no further than the R Project. It's a complete programming environment and is extensively used by working statisticians.

      I concur. I just wrote a script to do some AFLP analysis in perl (mainly for the mental excercise as a favour to someone), and aside from PDL that I don't know anything about, perl is pretty horrible for doing numerical stuff. R [r-project.org] on the other hand is pretty neat, particularly with an emacs front end. There's lots of mate

  • by Chacham ( 981 ) *
    Generating a visual representation is often the best way to understand large data sets,

    No, it is often the *worst*. What you meant to say is that it is the *easiest*. Learn to data first, and then check what is really important. Pictures help with a quick overview, but hide the real details.

Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (10) Sorry, but that's too useful.

Working...