in reply to Curious issue with Graphing Arrays
or else@name1 = (6, 18, 21, 28, 36, 44, 52, 67, 78, 89); @name2 = (1, 15, 22, 31, 45, 7, 19, 21, 36, 41); @name3 = (8, 91, 78, 88, 87, 80, 96, 95, 99, 99); @xaxis = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
In the latter case, you would change the @data assignment to$name1 = [6, 18, 21, 28, 36, 44, 52, 67, 78, 89]; $name2 = [1, 15, 22, 31, 45, 7, 19, 21, 36, 41]; $name3 = [8, 91, 78, 88, 87, 80, 96, 95, 99, 99]; $xaxis = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
The reason is that with your current code, you're actually creating three one-element arrays, each containing an array reference as its first element. Also, if you do go with the first approach, no need to duplicate the contents of the arrays. Just do@data = ( $xaxis, $name1, $name2, $name3 );
@data = ( \@xaxis, \@name1, \@name2, \@name3 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Curious issue with Graphing Arrays
by SoaponaRope (Novice) on Nov 13, 2007 at 20:49 UTC |