Surface NMR processing and inversion GUI
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435
  1. from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
  2. from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
  3. from matplotlib.figure import Figure
  4. import numpy as np
  5. import sys
  6. from PyQt5 import QtCore, QtGui
  7. #from mydynamicmplcanvas import MyMplCanvas
  8. class MyMplCanvasN(FigureCanvas):
  9. """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.)."""
  10. def __init__(self, parent=None, width=3, height=.2, dpi=100):
  11. self.fig = Figure(figsize=(width, height), dpi=dpi)
  12. FigureCanvas.__init__(self, self.fig)
  13. self.setParent(parent)
  14. FigureCanvas.updateGeometry(self)
  15. def compute_initial_figure(self):
  16. pass
  17. def clicked(self):
  18. print ("Clicked")
  19. class MyDynamicMplCanvasNavigator(MyMplCanvasN):
  20. def __init__(self, *args, **kwargs):
  21. MyMplCanvasN.__init__(self, *args, **kwargs)
  22. def setCanvas(self, canvas):
  23. NavigationToolbar(canvas, self)