I am trying to use matplotlib and display result, I have yocto based image with xWayland backend (fsl-image-qt5).
import numpy as np
import matplotlib.pyplot as pltx = np.linspace(-np.pi, np.pi, 256, endpoint=True)
c, s = np.cos(X), np.sin(X)plt.plot(x, c)
plt.plot(x, s)plt.show()
After running this script plot is not displayed. How to make it display window?
Hello Erik Raynolds,
Matplot is not part of the i.MX BSP so I haven’t tested it but I would recommend first making sure that matplot is compatible with Wayland as the problem may be that the library is not reaching the backend. Maybe the matplot documentation or matplot related forums may be useful to check this.
Regards,
So assuming yes it's part of - since I just added to local.conf and is within python ...
Hello Erik! Sorry for replying on old post, but I'm having similar issue using Qt5Agg backend and Yocto on i.MX7. I tried Matplotlib, pyqtchart and pyqtgraph, but neither of them display the plot. Matplotlib just have white area instead of the plot (but window and Toolbar is displayed ok), QChart display's line series sometimes (not properly scaled though) but no axes, pyqtgraph just crashes. On the other hand QChart from qml app works fine. I'm using pure samples from documentation of corresponding libraries. They all tested to work under Ubuntu 18.04, but fail on i.MX7. Have you had any luck to solve your issue? If yes, do you recall what was the reason?