Advertisement
Guest User

matplotlib figure gets deleted

a guest
Mar 15th, 2010
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. In [1]: import numpy as np
  2.  
  3. In [2]: from matplotlib import pyplot as plt
  4.  
  5. In [3]: import pylab
  6.  
  7. In [4]: centerNormal = pylab.load("centerNormal")
  8.  
  9. In [5]: pointProject = pylab.load("pointProject")
  10.  
  11. In [6]: myFigure = plt.figure(figsize=(30,30))
  12.  
  13. In [7]: myAxis = myFigure.add_subplot(1,1,1)
  14.  
  15. In [8]: pointProject.shape
  16. Out[8]: (208, 4)
  17.  
  18. In [9]: pointProject[:,0].shape
  19. Out[9]: (208,)
  20.  
  21. In [10]: pointProject[:,2].shape
  22. Out[10]: (208,)
  23.  
  24. In [11]: myAxis.plot(pointProject[:,0],pointProject[:,2],'ro')
  25. Out[11]: [<matplotlib.lines.Line2D object at 0x93e7c2c>]
  26.  
  27. In [12]: myFigure.show()
  28.  
  29. In [13]: myAxis.set_aspect('equal')
  30.  
  31. In [14]: myFigure.show()
  32. ---------------------------------------------------------------------------
  33. RuntimeError                              Traceback (most recent call last)
  34.  
  35. /home/tomislav/OpenFOAM/tomislav-1.5-dev-debug/run/MASTER/circleCases/hexMesh/voFoamCircleHexa/<ipython console> in <module>()
  36.  
  37. /usr/lib/python2.5/site-packages/matplotlib/backends/backend_qt4.pyc in <lambda>(*args)
  38.     239
  39.     240         # attach a show method to the figure for pylab ease of use
  40. --> 241         self.canvas.figure.show = lambda *args: self.window.show()
  41.     242
  42.     243         def notify_axes_change( fig ):
  43.  
  44. RuntimeError: underlying C/C++ object has been deleted
  45.  
  46. In [16]:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement