use GD::Simple; use Chart::Gnuplot; my $image = GD::Simple->new(400, 40); $image->trueColor(1); $image->bgcolor('white'); $image->fgcolor('black'); $image->font('courier'); $image->fontsize(20); $image->moveTo(1,21); #$image->string("Just Another Perl Hacker"); $image->string("just another perl hacker"); my $W = $image->width(); my $H = $image->height(); my ($x, $y, $r, @onX, @onY); for ($x=0; $x<$image->width(); $x++) { for ($y=0; $y<$image->height(); $y++) { $r = $image->getPixel($x,$y); if( $r > 0 ){ push @onY, $x; push @onX, $y; } }} my $dataSet = Chart::Gnuplot::DataSet->new( xdata => \@onX, ydata => \@onY, title => undef, style => "dots", ); # Create chart object and specify the properties of the chart my $chart = Chart::Gnuplot->new( title => undef, xlabel => undef, ylabel => undef, terminal => 'dumb size 40,180', ); # Plot the data set on the chart $chart->plot2d($dataSet);