buchi2 has asked for the wisdom of the Perl Monks concerning the following question:
I have to plot several diagramms and want to do it with chart::gnuplot.
It needs the x and y as arrayref withI want to plot the diagramms with a loop.xdata => \@xarray, ydata => \@yarray,
The prints in the loop are for checking. It seems all correct.# die Plotfelder/-hashe belegen und hash istart $ii = -1; for ($i = 0; $i <= $#yfeld; $i++) { # next if ($yfeld[$i] == 0); $ii = $ii + 1; print "$i $ii "; push(@ploty,$yfeld[$i]); push @{$istart{$ii}}, $istart[$i]; push @{$ianz{$ii}}, $ianz[$i]; if ($xfeld[$i] eq 'x') { push @{$plotx{$ii}}, @xfix; print "x\n"; } elsif ($xfeld[$i] eq 'y') { push @{$plotx{$ii}}, @yfix; print "y\n"; } else { push @{$plotx{$ii}}, $fnfeld[$xfeld[$i]]->{'fn'}; print "$xfeld[$i]\n"; } } print "\n"; print "2 $plotx{2}[3]\n"; print "3 $plotx{3}[3]\n"; print "5 $plotx{5}[3]\n"; # ? print "6 $plotx{6}[3]\n"; print "7 $plotx{7}[3]\n"; # ? print "8 $plotx{8}[3]\n"; # ? print "9 $plotx{9}[3]\n";
I ommit the index 0, 1, 4, because it is empty (0 in the first print-block).0 0 0 1 1 0 2 2 y 3 3 y 4 4 0 5 5 5 6 6 x 7 7 5 8 8 5 9 9 y
So it means, that something goes wrong, where I want to assign the fnfeld to my plotx.2 3.640000E-04 3 3.640000E-04 Use of uninitialized value in concatenation (.) or string at test.pl l +ine 590. 5 6 3.640250E-04 Use of uninitialized value in concatenation (.) or string at test.pl l +ine 592. 7 Use of uninitialized value in concatenation (.) or string at test.pl l +ine 593. 8 9 3.640000E-04
But how can I assing the values from the array of hashes, which contains an array?ydata => $fnfeld[$ploty[$ii]]->{'fn'},
Regards, buchi
|
---|