Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Plaintext plot - existing sofware?

by parv (Vicar)
on Jul 21, 2021 at 13:57 UTC ( #11135266=note: print w/replies, xml ) Need Help??


in reply to Re: Plaintext plot - existing sofware?
in thread Plaintext plot - existing sofware?

Thanks for showing that gnuplot can produce a text plot. I got overwhelmed by the documentation about multitude of terminals; did not find that myself earlier.

  • Comment on Re^2: Plaintext plot - existing sofware?

Replies are listed 'Best First'.
Re^3: Plaintext plot - existing sofware?
by bliako (Monsignor) on Jul 22, 2021 at 10:08 UTC

    my phd was a loooong gnuplot script

    and here is the time-honored japhy - my first one!

    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);
    400 +-----------------------------+ | + + + | | | | | | | | | | | | . . | | .. . . | | .. . . | | .. . . . | | .. .. .. .. .. . | | .. . . | | . . . | | | | . .. .. .. . | | .. . .. . . | | .. .. . . | | .. .. . . | | .. .. .. .. .. | | .. .. .. . | | | 350 |-+ .. . . +-| | .. . . .. . | | .. .. . .. .. . | | .. .. . | | .. .. .. .. .. .. .. . | | . . . | | | | .. .. . .. | | .. . .. . | | .. . . | | .. . . | | .. .. .. .. .. . | | . .. .. | | | | . . | | .. .. .. .. .. . | | .. .. .. . | | .. .. . . | | .. .. .. .. . | | . .. .. | | | | . . | 300 |-+ .. .. .. .. .. . +-| | .. . | | .. . . | | .. .. .. .. .. .. .. . | | .. .. .. .. .. .. .. . | | | | | | | | | | | | | | | | | | . . | | . . | | .. .. .. .. .. .. .. . | | .. .. .. .. .. .. .. . | | . . . | | . . . | | | | .. . | | .. . . | 250 |-+ .. . . . +-| | .. .. .. .. .. . | | .. .. .. .. .. . | | .. . . | | | | . .. .. | | . .. .. .. . | | .. . .. . . | | .. .. . . | | .. . .. .. . | | . .. .. .. .. | | .. . | | .. .. .. . | | .. .. . .. . | | .. . . | | .. . . .| | .. .. . .. .. . .| | .. .. .. .. .. .. .. .| | .. .| | | | | | | 200 |-+ +-| | | | | | | | .. . | | .. . . | | .. . . . | | .. .. .. .. .. . | | .. .. .. .. .. . | | .. . . | | | | . .. .. | | . .. .. .. . | | .. . .. . . | | .. .. . . | | .. . .. .. . | | . .. .. .. .. | | .. . | | . . | | .. .. .. .. .. . | | .. . . . | | .. | 150 |-.. .. .. .. .. .. .. . +-| | .. .. .. .. .. .. .. . | | . . . | | | | .. .. . | | .. . . | | .. . . | | .. .. .. .. .. .. .. . | | .. .. .. .. .. .. . | | .. | | . | | . .. .. .. .. | | .. . .. . | | .. . . | | .. . .. . | | . .. .. .. .. | | . | | . . | | .. .. .. .. .. . | | .. . . . | | .. | | .. . . . | 100 |-+ .. .. .. .. .. . +-| | .. . . | | . . | | .. .. .. .. . | | .. .. .. .. .. . | | .. .. . . | | .. .. . . | | .. .. .. .. . | | . . | | | | | | | | | | | | | | | | | | .. . | | .. . . | | .. . . | | . .. .. .. .. .. .. . | | .. .. .. .. .. .. .. | 50 |-+ .. +-| | | | .. .. . .. .. | | .. .. .. .. .. . | | .. .. . . | | .. . .. . . | | .. .. . . .. . | | . .. . | | . . | | .. .. .. .. .. . | | .. .. .. .. .. . | | .. . .. | | . . | | .. .. .. .. .. . | | .. | | | | .. .. .. .. .. .. . | | .. .. .. .. .. .. .. .. .| | .. .. .| | .. .| | .. .| | + + + | 0 +-----------------------------+ 5 10 15 20 25

    bw, bliako

        sorry for the initial disappointment :) interesting links

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2021-12-01 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (15 votes). Check out past polls.

    Notices?