Forum Archive

Pythonista crashes for me

KlMa

Hi
I am using Pythonista 2.1 on a ipad air and having problems with Pythonista crashing. Maybe matplotlib is involved, but its difficult for me to say. If I for example try to add a row after the plt.plot(np.arange... row below and start to write "plt.plo..." and wait a few seconds it crashes. I see the problem in other scripts using matplotlib as well. Any ideas?
```

coding: utf-8

import console
import motion
import time
import numpy as np
import matplotlib.pyplot as plt

def show(ori_func, ft, sampling_period):
n = len(ori_func)
interval = sampling_period / n
plt.subplot(2, 1, 1)
plt.plot(np.arange(0, sampling_period, interval), ori_func, 'black')
plt.xlabel('Time'), plt.ylabel('Amplitude')
plt.subplot(2,1,2)
frequency = np.arange(n / 2) / (n * interval)
nfft = abs(ft[range(int(n / 2))] / n )
plt.plot(frequency, nfft, 'red')
plt.xlabel('Freq (Hz)'), plt.ylabel('Amp. Spectrum')
plt.show()
```

ccc

https://forum.omz-software.com/topic/3355/matplotlib-plt-scatter-1-1-crashes-editor

KlMa

Ok thanks. Is there a way to use the beta or should i wait for the bug fix? Or should i buy Pythonista 3?

ccc

The latter is highly recommended. That is where you will see fastest progress.

The Beta signup form is discussed at https://forum.omz-software.com/topic/2747/python-3-x-progress-update/237

Vankjril

Let's see it right here: https://forum.omz-software.com/topic/3355/matplotlib-plt-scatter-1-1-crashes-editor

see my site: Facebook Viral Booster

RHH

I have experienced similar problems when using matplotlib. And it's entirely reproducible. If I enter the offending line as a comment, and then delete the pound (#) sign, I can work around it.