Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

creating graphs

by Anonymous Monk
on May 17, 2005 at 13:46 UTC ( #457800=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I have successful created graphs using GD before, however, is it possible to identify the peaks and label the coordinates on the graph? Is this a math* og graph* module? Thanks

Replies are listed 'Best First'.
Re: creating graphs
by holli (Monsignor) on May 17, 2005 at 14:12 UTC
    A quick cpan search yields Chart::Graph, which has a interface to the mighty Gnuplot. I never used it, but it may be worth a look.

    holli, /regexed monk/

      I have used Chart::Graph before, with excellent success. It helps to know gnuplot fairly well first (you can read a good guide). There is a bit of a learning curve. Gnuplot and Chart::Graph are very powerful; as a result, it can sometimes take a bit of study and trial to get exactly what you want.

      Of course, the upshot is that you can usually get exactly what you want.

      The Eightfold Path: 'use warnings;', 'use strict;', 'use diagnostics;', perltidy, CGI or CGI::Simple, try the CPAN first, big modules and small scripts, test first.

Re: creating graphs
by monkfan (Curate) on May 17, 2005 at 14:07 UTC
    AFAIK, not directly. For finding min/max you can use max-min function List::Util module on the array which you use for plotting.
    use List::Util qw(max min sum);
    As for the labels. I thought you it's you who put them in
    use GD::Graph::lines; my $my_graph = new GD::Graph::lines(); $my_graph->set( x_label => 'Label X', y_label => 'Label Y', title => 'Your Title');
      sorry, i mean labelling the peaks. perhaps place a number next to each peak on the graph
Re: creating graphs
by ghenry (Vicar) on May 17, 2005 at 14:59 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://457800]
Approved by Corion
marioroy updated Re: How to convert bunch of perl file + other dependent Input files Into a single executable. Unfortunately, PAR::Packer or dependency isn't multi-process or threads safe. But is possible to build an exe running MCE::Hobo.
marioroy Supporting the Windows platform isn't easy. ;-(
marioroy I tried to find the culprit module with unsafe DESTROY or END block, but too many dependencies and gave up.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2017-08-24 03:06 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (363 votes). Check out past polls.