GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Plot(3) User Contributed Perl Documentation Plot(3)

Imager::Plot - Perl extension for generating fancy graphic plots in color.

  use Imager;
  use Imager::Plot;

  $plot = Imager::Plot->new(Width  => 550,
                          Height => 350,
                          GlobalFont => 'ImUgly.ttf');

  my @X = 0..100;
  my @Y = map { sin($_/10) } @X;
  my @Z = map { 1+cos($_/10) } @X;

  $plot->AddDataSet(X  => \@X, Y => \@Z);
  $plot->AddDataSet(X  => \@X, Y => \@Y,
                  style=>{marker=>{size   => 2,
                                   symbol => 'circle',
                                   color  => Imager::Color->new('red'),
                               },
                      });

  $img = Imager->new(xsize=>600, ysize => 400);
  $img->box(filled=>1, color=>'white');

  $plot->{'Ylabel'} = 'angst';
  $plot->{'Xlabel'} = 'time';
  $plot->{'Title'} = 'Quality time';

  $plot->Render(Image => $img, Xoff => 40, Yoff => 370);
  $img->write(file => "testout.png");

This is a module for generating fancy raster plots in color. There is support for drawing multiple datasets on the same plot, over a background image. It's even possible to do shadows with some thinking.

It's also possible to generate clean plots without any chartjunk at all.

The plot is generated in a few phases. First the initial plot object is generated and contains defaults at that point. Then datasets are added with possible drawing specifications.

Most of the actual work is delegated to Imager::Plot::Axis. See the Imager::Plot::Axis manpage for more information on how to control grid generation, ranges for data (zoom).

For more on the drawing styles for Datasets see the Imager::Plot::DataSet manpage.

Arnar M. Hrafnkelsson, addi@umich.edu

2002-08-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.