Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Bug in Matplotlib?
-
I took this script from a matplotlib tutorial. It crashes Pythonista (latest beta) on an iPad Pro.
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2, 100)plt.plot(x, x, label='linear')
plt.plot(x, x2, label='quadratic')
plt.plot(x, x3, label='cubic')plt.xlabel('x label')
plt.ylabel('y label')plt.title("Simple Plot")
plt.legend()
plt.show()
-
@ihf typing error, code is
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 2, 100) plt.plot(x, x, label='linear') plt.plot(x, x**2, label='quadratic') plt.plot(x, x**3, label='cubic') plt.xlabel('x label') plt.ylabel('y label') plt.title("Simple Plot") plt.legend() plt.show()
-
@cvp I guess the double ** is treated as a formatter. In any case, the script crashes Pythonista.
-
@ihf I don't have any problem
-
Yes that is what it should look :-) It crashes Pythonista immediately on my iPad running the current beta. Is that what you are running?
-
@ihf You are right: if I force a run in Python 2.7, it crashes
Fatal Python error: Aborted Thread 0x000000016f2e3000 (most recent call first):
-
Yet another reason to run 3.6 rather than 2.7. BTW, where did you find the error msg? Is there a crash log?
-
@ihf pythonista_startup from @dgelessus see here
-
I apologize for this bug, this is in no way meant to force anyone to upgrade to 3.6, but I'd seriously recommend that you get on board with Python 3 quite soon, as it'll ensure that your code will continue to run without problems in the future.
I don't think that I'll remove Python 2.7 support from Pythonista in the near future, but a lot of new features require Python 3 already.
-
Also, now less than a year until Python 2 becomes unsupported by core developers, so no reason to build anything new on it.