Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python crashes if too many plotWindow() have been opened #7

Open
davidpagnon opened this issue Sep 20, 2023 · 4 comments
Open

Python crashes if too many plotWindow() have been opened #7

davidpagnon opened this issue Sep 20, 2023 · 4 comments

Comments

@davidpagnon
Copy link

Hi,

Thank you for this wrapper, it is quite useful.
When I open (and then close) a certain amount of plotWindow(), python crashes with error QGuiApplication::font(): no QGuiApplication instance and no application font set.

I know very little about PyQt5, and everything I tried did not work. Would you be able to provide this fix?
Thanks in advance.

@jsjax
Copy link

jsjax commented Sep 20, 2023

Can you provide a minimal repro script?

@davidpagnon
Copy link
Author

davidpagnon commented Sep 20, 2023

Sure! This crashes before the 3rd window is opened.

from plotWindow import plotWindow
import matplotlib.pyplot as plt
import numpy as np

for n in range(3):
	pw = plotWindow()
	x = np.arange(0, 10, 0.001)
	for i in range(1,3):
		f = plt.figure()
		ysin = np.sin(i*x)
		plt.plot(x, ysin, '--')
		pw.addPlot(str(i), f)
	pw.show()

@davidpagnon
Copy link
Author

Hi @jsjax, did you have a chance to look at this issue?

@davidpagnon
Copy link
Author

Issue posted on stackoverflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants