Skip to content

Instantly share code, notes, and snippets.

@ChrisBeaumont
Created December 4, 2012 21:13
Show Gist options
  • Save ChrisBeaumont/4208745 to your computer and use it in GitHub Desktop.
Save ChrisBeaumont/4208745 to your computer and use it in GitHub Desktop.
MPL set_cursor problem under 1.2.0
from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget
from PyQt4.QtCore import Qt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT
from matplotlib.figure import Figure
a = QApplication([''])
w = QMainWindow()
f = Figure()
ax = f.add_subplot(111)
ax.plot([1,2,3], [2, 3, 4])
canvas = FigureCanvasQTAgg(f)
tb = NavigationToolbar2QT(canvas, w)
dw = QDockWidget("test")
dw.setWidget(canvas)
w.addDockWidget(Qt.TopDockWidgetArea, dw)
w.addToolBar(tb)
w.show()
w.raise_()
a.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment