in reply to GD::Graph::points + multiple data sets

I may be missing the obvious here, but can't you concatenate the two arrays together?

@x_values_all = (@x_values1, @x_values2); @y_values_all = (@y_values1, @y_values2);
Tom Melly, tom@tomandlu.co.uk

Replies are listed 'Best First'.
Re: Re: GD::Graph::points + multiple data sets
by Anonymous Monk on Oct 08, 2003 at 13:28 UTC
    you can do this for the x-axis but not the y-axis too as then you will have only one data-set! I have tried the following, but it seems to miss out some data-points (not sure why).
    my @totalx_vals = (@x_vals1, @x_vals2); my @graph_data = (\@totalx_vals, \@y_vals1, \@y_vals2);

      I'm confused - you did try the logical thing of doing this twice - once for the 2 sets of x-vals and once for the 2 sets of y-vals?

      I haven't yet used GD::Graph, but the syntax you gave seems to imply that

      my @graph_data = (\@x_vals, \@y_vals)
      is the expected format. So...
      @x_vals = (@x_vals1, @x_vals2); @y_vals = (@y_vals1, @y_vals2); my @graph_data = (\@x_vals, \@y_vals);

      If this isn't the solution, then you'll have to wait for someone who knows perl and/or GD::Graph better than me...

      Tom Melly, tom@tomandlu.co.uk
        thanks for your help - but i'm trying to impose to sets of data on the same graph (e.g. with different colours). This method just merges both data-sets into 1. Cheers