Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2019-07-21 03:01 GMT
Find Nodes?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?

    Results (7 votes). Check out past polls.