Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I was wondering if anyone knows of some graph plotting functions/modules in perl that can add labels onto each point in a scatter graph (e.g. where each dot is labelled with a number)? I am also interested in finding something that can plot just the labels and not the dots onto a graph. Do these kinds of functions exist?
Many thanks!

Replies are listed 'Best First'.
Re: plotting graphs with perl
by g0n (Priest) on Feb 10, 2005 at 11:59 UTC
    Have you looked at

    GD::Graph

    ?

    VGhpcyBtZXNzYWdlIGludGVudGlvbmFsbHkgcG9pbnRsZXNz
Re: plotting graphs with perl
by kryberg (Pilgrim) on Feb 10, 2005 at 13:38 UTC
    GD::Graph lets you plot data point values above the point or bar. I've used that successfully with vertical bar charts.

    gnuplot allows you to set labels and plot them on the graph. You can use the data for label text and the position. gnuplot can be used at the command prompt, from within a perl script, or with the Perl module Chart::Graph::Gnuplot. I think there would be serveral ways to get the label but not plot the data. Once to suppress part of the graph, I just set the point size to 0, gnuplot still generated all the axes, titles, lables, etc., just no points representing the data.
Re: plotting graphs with perl
by cog (Parson) on Feb 10, 2005 at 10:08 UTC
    Not sure if it does all you need it to, but GD::Simple might be the tool for you.
Re: plotting graphs with perl
by m-rau (Scribe) on Feb 10, 2005 at 12:39 UTC
Re: plotting graphs with perl
by zentara (Cardinal) on Feb 10, 2005 at 14:07 UTC
    The Tk Canvas lets you do everything you want. Run the "widget", look under Canvases->A Simple 2D Plot.

    All you need to do is add the text at each plot point.


    I'm not really a human, but I play one on earth. flash japh