2
votes

I know gnuplot can handle histograms. I know perl is effectively doing a pass through when using Chart::gnuplot. And when I set plot type to histograms I don't get an error. But it does keep complaining that there are too many columns. Which is a bit baffling since I am only setting data for the y axis.

Has anyone ever plotted a histogram using Chart::gnuplot straight up? Example code?

3
Please add the code you're having trouble with. This will help us with what is a practically impossible question to answer, as written. - Alex Reynolds
Hey alex there is no example code, since there is no supported method for chart::gnuplot to create a histogram as a graph type. It's a limitation of chat::gnuplot. Cheers. - Matt Joyce

3 Answers

1
votes

There is no functionality to create histograms in the perl module Chart::gnuplot. You can regex a plot template and generate from a system / exec call.

0
votes

This URL does not help?

http://chartgnuplot.sourceforge.net/

here are examples - maybe for your problem too.

0
votes

To plot histogram by Chart::Gnuplot, the "using" option of the dataSet object need to be set as:

using => "2:xticlabels(1)"

Besides, please don't forgot to set the style as "histograms". E.g.

my $ds = Chart::Gnuplot::DataSet->new(
    xdata => [qw(A B C)],
    ydata => [1, 2, 3],
    using => "2:xticlabels(1)",
    style => "histograms",
);