matplotlib under Yocto to display result

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

matplotlib under Yocto to display result

1,003 Views
erikraynolds
Contributor III

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 plt

x = 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?

Labels (2)
Tags (1)
0 Kudos
3 Replies

855 Views
gusarambula
NXP TechSupport
NXP TechSupport

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,

0 Kudos

855 Views
erikraynolds
Contributor III

So assuming yes it's part of - since I just added to local.conf and is within python ...

0 Kudos

855 Views
timofey_babitsk
Contributor I

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?

0 Kudos