PlotPyStack / PythonQwt

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

Baseline not respected when plot has brush set #37

Closed estan closed 8 years ago

estan commented 8 years ago

I'm drawing a test curve with:

        y = linspace(1000, 0, 500)
        x = 0.5 + 0.5 * sin(y/50)

        self.curve = QwtPlotCurve('Test Curve')
        self.curve.setData(x, y)
        self.curve.setXAxis(QwtPlot.xTop)
        self.curve.setRenderHint(QwtPlotItem.RenderAntialiased)
        self.curve.setBrush(QBrush(Qt.blue))
        self.curve.attach(self)

And the result is:

baseline

Since the default baseline for a plot is 0.0, I would expect the area between the curve and the Y (X = 0) axis to be filled. Am I misunderstanding? I tried setting the baseline to 0 explicitly as well, but the result was the same.

estan commented 8 years ago

My bad, it was simply a matter of setting the curve to vertical orientation with self.curve.setOrientation(Qt.Vertical). Sorry for the noise and not reading the docs close enough!