[Graph-dev] arbitrary number of data series

Ollie Cook ollie at uk.clara.net
Fri Jan 2 15:26:02 PST 2004


On Fri, Jan 02, 2004 at 10:12:23AM -0600, Adam Pirkle wrote:
> If you take a look in Gnuplot.pm, that error message would be generated by
> 
> if (ref($user_data_options_ref) ne "HASH") {
>    carp "Data options must be a hash.";
>    return 0;
> }
> 
> (where $user_data_options_ref is equal to your $options)
> 
> So, something must have gone wrong when you created your options hash ref.

Hi Adam,

I looked at Gnuplot.pm before posting. I think the error isn't with $options,
as you state, but rather my array of 'data set elements'.

$user_data_options_ref isn't the first argument to gnuplot(), but rather the
options part of a 'data set element':

  [\%data_set_options, \@matrix]
    ^^ this part ^^

ref($user_data_options_ref) is actually an ARRAY, presumably due to the fact
that I passed an array rather than a list of 'data set elements', so there is
one further level of indirection before reaching the options hash. (I keep
putting that in single quotes, because I'm not sure what the correct term is
for them!)

Do you perhaps have an example of using arbitrary number of data series, or
perhaps know where I can look for one?

Thank you for your input so far.

Yours,

Ollie

-- 
Oliver Cook    Systems Administrator, Claranet UK
ollie at uk.clara.net                  020 7903 3065


More information about the Graph-dev mailing list