PlotPyStack / PythonQwt

Qt plotting widgets for Python (pure Python reimplementation of Qwt C++ library)
https://pypi.org/project/PythonQwt/
Other
86 stars 25 forks source link

ERROR #55

Closed 1PYTHON1 closed 4 years ago

1PYTHON1 commented 4 years ago

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

1PYTHON1 commented 4 years ago

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_()

PierreRaybaut commented 4 years ago

Hi, What version of PythonQwt have you installed?

PierreRaybaut commented 4 years ago

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).

PierreRaybaut commented 4 years ago

Fixed in V0.8.3 just released.

1PYTHON1 commented 4 years ago

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