|simple_drawing.pg||topic started 3/24/2003; 8:11:35 PM
last post 3/24/2003; 8:11:35 PM
|Michael Gage - simple_drawing.pg
3/24/2003; 8:11:35 PM (reads: 566, responses: 0)
|This is an example of doing very simple drawing using WWPlot.pm directly.
More complicated constructions can be constructed by using the properties described in the file GD.pm on CPAN. |
The object created by
$graph = init_graph(-5,5,5,5);
has the GD object
as it's drawing canvas.
## A very simple drawing problem
DOCUMENT(); # This should be the first executable line in the problem.
$graph = init_graph(-5,-5,5,5,ticks=>[4,4],axes=>[0,0],pixels=>[400,400]);
# At the moment there is no easy way to change the weight of the lines being drawn. To do so one would want
# to incorporate some of the code in Fun.pm into WWPlot.pm itself. The code involves gdBrushed.
# Since GD has
# gone through many revisions since the WWPlot.pm code was written it may now be possible to write some of
# this code more efficiently.
ENDDOCUMENT(); # This should be the last executable line in the problem.