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

Dear Monks,
I would like to able to plot a graph based on two arrays of numbers and then label the points on the graph according to a third array of words. I've been experimenting with Chart::Graph::Gnuplot and the 'extra_opts' variable but can't really see how to pass it my array of words so that it can plot them onto the graph.

In the actual gnuplot program you can say e.g. set label "Yield Point" at 0.003,260, however if I try this within the perl script I just get errors. Has anyone tried to do this before and could help??

Thanks!
my code is below:

gnuplot({"title" => "test", "x-axis label" => "axis1", "y-axis label" => "axis2", #"logscale x2" => "1", #"logscale y" => "1", "output type" => "png", "output file" => "gnuplot2.png", "extra_opts" => "set label" }, # want to put @names in here + somewhere [{"title" => "", "type" => "columns"}, \@x, \@y], );

Replies are listed 'Best First'.
Re: Chart::Graph::Gnuplot problems
by rg0now (Chaplain) on Feb 14, 2005 at 19:48 UTC
    I am not entirely sure about that, but as far as I can tell you, Chart::Graph::Gnuplot can not do intelligent labelling of data ponts. At least, I have never been able to make it do this. The problem seems to be that neither gnuplot calculates the labels for you and Chart::Graph::Gnuplot does not contain additional logic to do that.

    So, if you want labelling, you should definitely look into some other charting libraries on CPAN...

    rg0now