Skip to content

Commit

Permalink
Changed the use of pyglet plot module
Browse files Browse the repository at this point in the history
This example uses, as of now, the old pyglet plotting module
which is not working right now.
Changed so that it uses the new plot API.
Trying to fix sympy#10243
  • Loading branch information
tokencolour committed Dec 25, 2015
1 parent d665df5 commit 7fcd761
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/advanced/autowrap_ufuncify.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import mpmath
from sympy.utilities.autowrap import ufuncify
from sympy.utilities.lambdify import implemented_function
from sympy import symbols, legendre, Plot, pprint
from sympy import symbols, legendre, pprint
from sympy.plotting import plot


def main():
Expand All @@ -46,7 +47,7 @@ def main():
print("Compiling legendre ufuncs and checking results:")

# Let's also plot the ufunc's we generate
plot1 = Plot(visible=False)
#plot1 = Plot(visible=False)
for n in range(6):

# Setup the SymPy expression to ufuncify
Expand All @@ -72,8 +73,12 @@ def main():

# We can also attach the autowrapped legendre polynomial to a sympy
# function and plot values as they are calculated by the binary function
g = implemented_function('g', binary_poly)
plot1[n] = g(x), [200]
#g = implemented_function('g', binary_poly)
if n==0:
plot1=plot(expr, x, show=False)
else:
plot1.extend(plot(expr, x, show=False))


print("Here's a plot with values calculated by the wrapped binary functions")
plot1.show()
Expand Down

0 comments on commit 7fcd761

Please sign in to comment.