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

Wise fellow monks!

I wonder if you had experience plotting histograms with gnuplot via Graphics::GnuplotIF.

Until now I am trying with something like this:
use Graphics::GnuplotIF; my $plot = Graphics::GnuplotIF->new ( style => 'histogram', # one of the gnuplot line styles +(see below) title => "$mytitle", # string xlabel => '$myxlabel', # string ylabel => '$myylabel', # string xrange => [@myxrange], # array reference; autoscaling, +if empty yrange => [@myyrange], # array reference; autoscaling, +if empty plot_titles => [ "$titles" ], # array of strings; titles use +d in the legend persist => 0, # let plot windows survive after gnuplot +exits # 0 : close / 1 : survive ); $plot_glacier->gnuplot_plot_xy ( \@x, \@y ); $plot_glacier->gnuplot_pause();

But it does not work (message = "Graphics::GnuplotIF (object 4): problem closing communication to gnuplot").
Histograms are supported in gnuplot since version 4.2, so perhaps it is only that they are not supported in GnuplotIF. I know it can be done with other modules, but right now I am just interested in using GnuploIF to avoid module-code-clutter. Your words will be appreciated!

Thanks in advance,

Replies are listed 'Best First'.
Re: histograms with GnuplotIF ?
by Utilitarian (Vicar) on May 29, 2009 at 08:56 UTC
    I tend to write a gnuplot file directly, haven't come across GnuPlotIF before, looks interesting though

    However histograms are achieved with plot ...  using histeps not histogram ;)

      Thanks for the reply. GnuplotIF and those in the Chart family are good interfaces, but I agree with you that it is better to use Perl to write the configuration text file and then call gnuplot via system.