Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

Comment on creating graphs
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');
    Regards,
    Edward
      sorry, i mean labelling the peaks. perhaps place a number next to each peak on the graph
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 ghenry (Vicar) on May 17, 2005 at 14:59 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://457800]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-09-30 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (385 votes), past polls