Pyglet plotting

123 views
Skip to first unread message

Aaron Meurer

unread,
Nov 16, 2018, 3:53:51 PM11/16/18
to sy...@googlegroups.com
Does anyone use the pyglet plotting module in SymPy?

I've been unable to confirm whether or not it even works. Every
attempt I've made at using it results in an exception.

Can anyone get the following to work (from the docstring)?

from sympy.plotting.pygletplot import PygletPlot as Plot
from sympy import symbols
from sympy.abc import x, y, z
Plot(x*y**3-y*x**3)

You will need to install pyglet first, obviously.

Note in master, it definitely does not work in Python 3. I have a pull
request where I fixed some obvious Python 3 issues, but I still am not
able to get any plots https://github.com/sympy/sympy/pull/14748. Feel
free to try the above in my branch as well (asmeurer/pyglet-fixes).

Particularly if someone has Linux, which I suspect is the only
platform which it ever worked on.

If no one can confirm that the module even works, I think we should
remove it. It clearly has never worked in Python 3, but I think it
also has been broken in Python 2 for some time. It would also be
useful to test it from an old version of SymPy/Pyglet, prior to the
existing plotting module, where I know for a fact that it used to
work.

Aaron Meurer

Kalevi Suominen

unread,
Nov 17, 2018, 9:42:45 AM11/17/18
to sympy
It seems to "work" in pyglet-fixes in the sense that no error message is generated.
However, no plot will be visible.

sympy pr-14748$ python
Python 2.7.6 (default, Nov 13 2018, 12:45:42)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from sympy.plotting.pygletplot import PygletPlot as Plot
>>> from sympy import symbols
>>> from sympy.abc import x, y, z
>>> Plot(x*y**3-y*x**3)
[0]: -x**3*y + x*y**3, 'mode=cartesian'
>>>

Kalevi Suominen

Aaron Meurer

unread,
Nov 20, 2018, 6:56:49 PM11/20/18
to sy...@googlegroups.com
I tried an old version of SymPy (0.7.6), where I am pretty sure pyglet
used to work. It seems it doesn't work with the latest version of
pyglet (1.2.4). I tried 1.1.4. On Mac I have to use 32-bit system
Python (arch -32 /usr/bin/python2.7). The plot call works but doesn't
actually open a plot for me (the launcher just bounces in the Dock).

It would be helpful if someone can confirm that an old version of
sympy/pyglet does in fact work, and it stopped working at some point,
since pyglet is so finicky even when it does work (at least on Mac).

Then again, maybe that is another argument for removing it, even if it did work.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/e0198c6d-622f-4b96-9406-5016e2b2f6e0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages