@data contient les valeurs (x, y) à placer sur le graphique. Cela fonctionne très bien et j'obtiens un tracé rouge.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 my $graph = GD::Graph::lines->new(650, 300); $graph->set( x_label => 'positions', y_label => 'valeurs', title => "Rap. $report $run : Evolution du signal des pics uniques au cours du pyroséquençage", y_max_value => 16, y_tick_number => 8, y_label_skip => 2 ) or die $graph->error; $graph -> set(dclrs => ["lred"]); my $gd = $graph->plot(\@data) or die $graph->error; # dessin de la droite de régression sur le graphique my $x1 = 0; my $y1 = $intercept; my $x2 = 25; my $y2 = $slope * 25 + $intercept; $graph -> set(dclrs => ["blue"]); $gd = $graph->plot( \([$x1, $x2], [$y1, $y2]) ) or die $graph->error; open(IMG, ">P:/Theorie/Cathy/Myco_pyro/graphiques/Rap${report}_$run.jpg") or die $!; binmode IMG; print IMG $gd->png;
J'aimerais sur le même graphique ajouter 2 autres points [$x1, $x2], [$y1, $y2] joints par une ligne bleue. Est-ce possible?
Merci pour votre aide,









Répondre avec citation
Partager