PlotPyStack/PythonQwt

ERROR

1PYTHON1 opened this issue · 5 comments

app = qwt.qt.QtGui.QApplication([])
AttributeError: module 'qwt' has no attribute 'qt'

I get an error when executing this example code

import qwt
import numpy as np

app = qwt.qt.QtGui.QApplication([])

Create plot widget

plot = qwt.QwtPlot("Trigonometric functions")
plot.insertLegend(qwt.QwtLegend(), qwt.QwtPlot.BottomLegend)

Create two curves and attach them to plot

x = np.linspace(-10, 10, 500)
qwt.QwtPlotCurve.make(x, np.cos(x), "Cosinus", plot, linecolor="red", antialiased=True)
qwt.QwtPlotCurve.make(x, np.sin(x), "Sinus", plot, linecolor="blue", antialiased=True)

Resize and show plot

plot.resize(600, 300)
plot.show()
app.exec_()

Hi,
What version of PythonQwt have you installed?

My bad... forgot to update the simple plot example in documentation following V0.8.0 (i.e. when I switched from an internal Qt-compatibility layer to the QtPy library, thus changing all the Qt-related imports).

Fixed in V0.8.3 just released.

I have version 0.8.0 installed, now I will update it, thanks for answering.