Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Editing an existing excel

by bliako (Monsignor)
on Oct 26, 2021 at 15:33 UTC ( [id://11138073]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Editing an existing excel
in thread Editing an existing excel

Plotting a histogram with Perl can be achieved using GD::Graph::histogram or via Chart::Gnuplot. I will demonstrate the latter since the former already has a demo.

use Chart::Gnuplot; my @counts = (10,11,20,5,13,19); my @labels = ('a'..'f'); my $dataSet = Chart::Gnuplot::DataSet->new( xdata => \@labels, ydata => \@counts, title => "Histogram", style => "histograms", ); # Create chart object and specify the properties of the chart my $chart = Chart::Gnuplot->new( title => "Simple testing", xlabel => "My x-axis label", ylabel => "My y-axis label", # this dumbs an ASCII histogram to console #terminal => 'dumb', # this plots it as a PNG output => 'x.png', terminal => 'png', ); # Plot the data set on the chart $chart->plot2d($dataSet);

bw, bliako

Replies are listed 'Best First'.
Re^4: Editing an existing excel
by thonny (Initiate) on Oct 26, 2021 at 16:16 UTC
    I am getting this error "Can't locate Chart/Gnuplot.pm in @INC". I tried installing but I keep getting
    Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz LWP failed with code[500] message[LWP::Protocol::MyFTP: connect: Conne +ction timed out] Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz Trying with "/usr/intel/bin/wget -O -" to get ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz --2021-10-26 23:53:56-- ftp://ftp.perl.org/pub/CPAN/authors/01mailrc. +txt.gz => ‘-’ Resolving ftp.perl.org (ftp.perl.org)... 203.178.137.175 Connecting to ftp.perl.org (ftp.perl.org)|203.178.137.175|:21... faile +d: Connection timed out. Retrying. --2021-10-26 23:56:09-- ftp://ftp.perl.org/pub/CPAN/authors/01mailrc. +txt.gz (try: 2) => ‘-’ Connecting to ftp.perl.org (ftp.perl.org)|203.178.137.175|:21... faile +d: Connection timed out. Retrying. --2021-10-26 23:58:21-- ftp://ftp.perl.org/pub/CPAN/authors/01mailrc. +txt.gz (try: 3) => ‘-’ Connecting to ftp.perl.org (ftp.perl.org)|203.178.137.175|:21... faile +d: Connection timed out. Retrying. --2021-10-27 00:00:35-- ftp://ftp.perl.org/pub/CPAN/authors/01mailrc. +txt.gz (try: 4) => ‘-’ Connecting to ftp.perl.org (ftp.perl.org)|203.178.137.175|:21... faile +d: Connection timed out. Retrying.

      I am sorry, I have no idea. It looks like you have some connection errors. For me, wget 'ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz' works fine.

      Note: most likely you will also have to install the gnuplot package for your system. Either with the system package manager, for example dnf, apt-get, etc., if it's some Linux or download the source from https://sourceforge.net/projects/gnuplot/files/gnuplot/ and compile&install or download a binary dist from http://www.gnuplot.info/download.html

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138073]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-18 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found