Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
# @filtered_option1 and 2 look like this: 0.4025 -0.606897 -0.158242 +0.2025 -0.24058 0.131667 -0.085 -1.1234 -0.093793 -0.458974 0.360345 +-0.420438 0.060759 -0.183562 -0.726804 0.867273 -0.41 -0.391667 -0.02 +4828 -0.410113 0.263917 -0.746429 -0.068269 -0.455814 ### IT WORKS FOR THESE BELOW!! #my @x = ("0.4025" ,"-0.606897", "-0.158242" ,"0.2025", "-0.24058", "0 +.131667", "-0.085", "-1.1234"); #my @y = ("0.4025" ,"-0.606897", "-0.158242" ,"0.2025", "-0.24058", "0 +.131667", "-0.085", "-1.1234"); + + + + + my @x = @filtered_option1; my @y = @filtered_option2; + + my $x = @x; my $y = @y; # TO CHECK THAT THEY HAVE THE SAME NUM ELEMENTS print "x is $x y is $y\n"; + + + + my $img = Chart::Plot->new(450,450); + + $img->setData(\@x, \@y); $img->setGraphOptions (_title => 'My graph'); open (WR,'>plot.png') or die ("Failed to write file: $!"); binmode WR; # for DOSish platforms print WR $img->draw(); close WR; print qq(<img src=\"plot.png\" width=450 height=450>); + + + + + # PLOTS THE AXIS BUT NO DATA-POINTS
|
|---|