Hello Mario,
Thanks for your interest in Maxima. Here is another way to plot
a list of data points. Since plot2d writes a file containing
some points and then calls gnuplot, we can let plot2d handle
the file output for us. This simplifies the problem somewhat.
Suppose xy is a list of the form [[x1, y1], [x2, y2], [x3, y3], ...]
We'll define two functions, xx and yy, which retrieve elements
from this list, and then make a parametric plot with xx and yy.
nxy: length (xy);
xx(i) := xy [fix (i)] [1];
yy(i) := xy [fix (i)] [2];
plot2d ([parametric, '(xx(i)), '(yy(i)), [i, 1, nxy], [nticks,
nxy]]);
Or if you have a list x of the form [x1, x2, x3, ...] then
nx: length (x);
ii(i) := i;
xx(i) := x [fix (i)];
plot2d ([parametric, '(ii(i)), '(xx(i)), [i, 1, nx], [nticks, nx]]);
In either case you can look at maxout.gnuplot to see the
list of points that are plotted -- the list should be exactly
the same as the list xy or x.
Using the "parametric" keyword takes plot2d down a path which
apparently avoids the adaptive plotting logic. As such this
approach is just a hack which will break if parametric plotting
is changed to use adaptive plotting logic or changed in some
other way. Parametric plotting also ignores useful keywords
such as "gnuplot_curve_styles" which otherwise could select
points instead of lines; I would say that's a bug.
It is possible to work around the adaptive plotting logic
in an ordinary (non-parametric) plot, but it's more involved
and probably even more fragile.
Probably there should be a way to explicitly disable adaptive
plotting so that this kind of workaround isn't necessary.
Hope this helps,
Robert Dodier
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250