-1

i have this python code that show 3d lines in matplotlib figure. i used plt.show() to show figure. but i want to show figure inside form that created by 'pyQt'. the form include "Widget" and "pushButton" , i want to show 3d figure inside widget when i click on the button. how can i do that ?

code :

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x, y, z = [1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 4], [6, 5, 3, 2, 1, 2, 4, 5, 6, 100, 6], [6, 5, 3, 2, 5, 5, 7, 8, 6, 3, 1]
ax.plot_wireframe(x, y, z)
plt.show()

and this is the form picture : Form

  • Possible duplicate of http://stackoverflow.com/questions/12459811/how-to-embed-matplotib-in-pyqt-for-dummies – Jérôme Apr 21 '15 at 16:07

1 Answers1

1

You may want to have a look at the docs:

http://matplotlib.org/examples/user_interfaces/embedding_in_qt4.html

Maybe also examples:

http://www.technicaljar.com/?p=688

http://eli.thegreenplace.net/2009/01/20/matplotlib-with-pyqt-guis/

Searching for pyqt and matplotlib should give a few interesting results.

Jérôme
  • 13,328
  • 7
  • 56
  • 106