NAME
Graphics::Grid::Grob::Points - Points grob
VERSION
version 0.001
SYNOPSIS
use Graphics::Grid::Grob::Points;
use Graphics::Grid::GPar;
my $points = Graphics::Grid::Grob::Points->new(
x => [ map { rand() } (0 .. 9) ],
y => [ map { rand() } (0 .. 9) ],
pch => "A",
gp => Graphics::Grid::GPar->new());
# or use the function interface
use Graphics::Grid::Functions qw(:all);
my $points = points_grob(%params);
DESCRIPTION
This class represents a "points" graphical object.
ATTRIBUTES
x
A Grahpics::Grid::Unit object specifying x-values.
Default to an array ref of 10 numbers from rand()
.
y
A Grahpics::Grid::Unit object specifying y-values.
Default to an array ref of 10 numbers from rand()
.
x
and y
combines to define the points. x
and y
shall have same length, which is the number of points in the grob object.
pch
Plotting character. A single value to indicate what sort of plotting symbol to use. See points for the interpretation of these values.
Graphics::Grid::Unit object specifying the size of the plotting symbols. Default to unit(1, "char")
.
vp
A viewport object. When drawing a grob, if the grob has this attribute, the viewport would be temporily pushed onto the global viewport stack before drawing takes place, and be poped after drawing. If the grob does not have this attribute set, it would be drawn on the existing current viewport in the global viewport stack.
elems
Get number of sub-elements in the grob.
Grob classes shall implement a _build_elems()
method to support this attribute.
METHODS
length
This is an alias of elems
.
extents($grid)
Returns info about the grob's extents (bounding box, etc) on the drawing layer, in cm.
Note that not all grob classes have got this method implemented.
For this module elems
returns the number of points.
SEE ALSO
AUTHOR
Stephan Loyd <sloyd@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018-2023 by Stephan Loyd.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.