Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

See the source. I haven't got a clue what "line" is supposed to be, but presumably it's some sort of graphics objects. So you'd need

L = line([(1,2),(2,3),(4,2)])
gnuplot(L)

But even that raises an exception for me, even after I install both gnuplot and gnuplotpy spkgs.

gnuplot> set terminal aqua
                  ^
     line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list
<snip>
   1032             if isinstance(other, Graphics3d):
   1033                 return self.plot3d() + other
-> 1034             raise TypeError, "other (=%s) must be a Graphics objects"%other
   1035         g = Graphics()
   1036         g._objects = self._objects + other._objects

TypeError: other (=
) must be a Graphics objects

So I think one really has to actually send the gnuplot string command. This did something, though not useful to me:

sage: gnuplot('set term svg')
sage: gnuplot('plot sin(x)/x')

Even

sage: gnuplot('set terminal')

which is supposed to give a list, stops with the first set of things, because Sage interprets that as the end of the output.

As you can see in that file, this is very old code that hasn't been used much. For instance, the plot method doesn't have any useful documentation. You probably have to already know gnuplot syntax to use it, and how to get the terminal to do its thing.