in reply to Re^2: GD::graph: layout Question.
in thread GD::graph: layout Question.
However, I tried to put your data into the exact same script, and it wouldn't go to 0...... I think GD::Graph::lines is buggy about this. I tried mapping your data, tried changing your text axis marks to numeric... (0,1,2,3).... and it still wouldn't shift. Very aggravating.#!/usr/bin/perl use warnings; use strict; use GD::Graph::lines; # See: http://perlmonks.org?node_id=629955 use constant PI => 4 * atan2(1,1); print STDERR "Processing sample55\n"; my @x = map {$_ * 3 * PI/100} (0 .. 100); my @y = map sin, @x; my @z = map cos, @x; my @data = (\@x,\@y,\@z); my $my_graph = new GD::Graph::lines(400,400); $my_graph->set( x_label => 'Angle (Radians)', y_label => 'Trig Function Value', x_tick_number => 'auto', y_tick_number => 'auto', title => 'Sine and Cosine', line_width => 1, x_label_position => 1/2, r_margin => 15, transparent => 0, ); $my_graph->set_legend('Thanks to Scott Prahl'); my $gd = $my_graph->plot(\@data); open (IMG, ">$0.png") or die $!; binmode IMG; print IMG $gd->png; close IMG;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: GD::graph: layout Question.
by Anonymous Monk on Aug 18, 2007 at 15:46 UTC |