[LON-CAPA-users] variable number of curves in a gnuplot problem
Guy Albertelli II
lon-capa-users@mail.lon-capa.org
Thu, 19 Feb 2004 15:43:02 -0500 (EST)
Hi Hon-Kie,
> I am trying to creating a gnuplot problem that may have, say 5-8 curves or
> points. I haven't been able to figure out how to do this since under
> gnuplot tag, I have to specify the
>
> <curve name="" linestyle="lines" pointtype="0" color="x003399">
> <data>@X</data> <data>@Y</data>
> </curve>
>
> for each curve beforehand. How do I write it so the number of curves are
> not set but determined by a random assignment.
Something like this should work:
<script type="loncapa/perl">
$curves=&random_curve_set();
$gnuplot=&xmlparse('<gnuplot ....>'.$curves.'</gnuplot>';
</script>
<display>$gnuplot</display>
--
guy@albertelli.com LON-CAPA Developer 0-7-4-9-