line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1523
|
use GD::Graph::lines; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
require 'save.pl'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
print STDERR "Processing sample56 (experimental)\n"; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $path = $ENV{GDGRAPH_SAMPLES_PATH} ? $ENV{GDGRAPH_SAMPLES_PATH} : ''; |
7
|
|
|
|
|
|
|
@data = read_data("${path}sample54.dat") |
8
|
|
|
|
|
|
|
or die "Cannot read data from ${path}sample54.dat"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$my_graph = new GD::Graph::lines(); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$my_graph->set( |
13
|
|
|
|
|
|
|
x_label => 'Wavelength (nm)', |
14
|
|
|
|
|
|
|
y_label => 'Absorbance', |
15
|
|
|
|
|
|
|
title => 'Numerical X axis', |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
y_min_value => 0, |
18
|
|
|
|
|
|
|
y_max_value => 2, |
19
|
|
|
|
|
|
|
y_tick_number => 8, |
20
|
|
|
|
|
|
|
y_label_skip => 4, |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
x_tick_number => 14, |
23
|
|
|
|
|
|
|
x_min_value => 100, |
24
|
|
|
|
|
|
|
x_max_value => 800, |
25
|
|
|
|
|
|
|
x_ticks => 1, |
26
|
|
|
|
|
|
|
x_tick_length => -4, |
27
|
|
|
|
|
|
|
x_long_ticks => 1, |
28
|
|
|
|
|
|
|
x_label_skip => 2, |
29
|
|
|
|
|
|
|
x_tick_offset => 2, |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
no_axes => 1, |
32
|
|
|
|
|
|
|
line_width => 2, |
33
|
|
|
|
|
|
|
x_label_position => 1/2, |
34
|
|
|
|
|
|
|
r_margin => 15, |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
transparent => 0, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$my_graph->set_legend('Thanks to Scott Prahl and Gary Deschaines'); |
40
|
|
|
|
|
|
|
$my_graph->plot(\@data); |
41
|
|
|
|
|
|
|
save_chart($my_graph, 'sample56'); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub read_data |
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
my $fn = shift; |
47
|
|
|
|
|
|
|
local(*ZZZ); |
48
|
|
|
|
|
|
|
my @d = (); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
open(ZZZ, $fn) || return (); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
while () |
53
|
|
|
|
|
|
|
{ |
54
|
|
|
|
|
|
|
chomp; |
55
|
|
|
|
|
|
|
my @row = split; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
for (my $i = 0; $i <= $#row; $i++) |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
undef $row[$i] if ($row[$i] eq 'undef'); |
60
|
|
|
|
|
|
|
unshift @{$d[$i]}, $row[$i]; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
close (ZZZ); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
return @d; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |