Chart-Plot

 view release on metacpan or  search on metacpan

Plot.pm  view on Meta::CPAN

  # initialize custom tick labels
  ($self->{'_xTickLabels'}, $self->{'_yTickLabels'}) = (0,0);

  #  allocate some colors
  $self->{'_white'} = $self->{'_im'}->colorAllocate(255,255,255);
  $self->{'_black'} = $self->{'_im'}->colorAllocate(0,0,0);
  $self->{'_red'} = $self->{'_im'}->colorAllocate(255,0,0);
  $self->{'_blue'} = $self->{'_im'}->colorAllocate(0,0,255);
  $self->{'_green'} = $self->{'_im'}->colorAllocate(0,255,0);

  # make the background transparent and interlaced
  $self->{'_im'}->transparent($self->{'_white'});
  $self->{'_im'}->interlaced('true');

  # Put a black frame around the picture
  $self->{'_im'}->rectangle( 0, 0,
			     $self->{'_imx'}-1, $self->{'_imy'}-1,
			     $self->{'_black'});

  # undocumented: in script, use as $plotObject->{'_debugging'} = 1;
  $self->{'_debugging'} = 0;
}

Plot.pm  view on Meta::CPAN

=head1 USAGE

=head2 Create an image object: new()

    use Chart::Plot; 

    my $img = Chart::Plot->new; 
    my $img = Chart::Plot->new ( $image_width, $image_height ); 
    my $anotherImg = new Chart::Plot; 

Create a new empty image with the new() method. It will be transparent
and interlaced if your version of GD supports gif format.  png does
not yet support either. If image size is not specified, the default is 400
x 300 pixels, or you can specify a different image size. You can also
create more than one image in the same script.

=head2 Acquire a dataset: setData()

    $img->setData (\@data);
    $img->setData (\@xdata, \@ydata);
    $img->setData (\@data, 'red_dashedline_points'); 



( run in 0.482 second using v1.01-cache-2.11-cpan-0a6323c29d9 )