Created
December 4, 2012 21:13
-
-
Save ChrisBeaumont/4208745 to your computer and use it in GitHub Desktop.
MPL set_cursor problem under 1.2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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