-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
Consider the code
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import Qt
import qwt
import numpy as np
app = QtWidgets.QApplication([])
x = np.linspace(0, 4*np.pi, 100)
y = np.cos(x)
plot = qwt.QwtPlot("Sine function")
plot.enableAxis(plot.xBottom, False) #|Disable axes enabled by default
plot.enableAxis(plot.yLeft, False) #|
plot.insertLegend(qwt.QwtLegend(), qwt.QwtPlot.BottomLegend)
qwt.QwtPlotCurve.make(x, y, "Sinus", plot, linecolor="blue", antialiased=True)
c = QtGui.QColor('purple')
sz = 10
s = qwt.QwtSymbol.make(
style=qwt.QwtSymbol.Ellipse,
brush=QtGui.QBrush(c), pen=QtGui.QPen(c),
size=QtCore.QSize(sz, sz))
step = 5
for xi, yi in zip(x[::step], y[::step]):
l = qwt.QwtText.make(text=f'{yi:0.2f}', pointsize=8)
qwt.QwtPlotMarker.make(
xvalue=xi, yvalue=yi,
label=l,
symbol=s,
align=Qt.AlignTop,
plot=plot)
plot.resize(1200, 600)
plot.show()
app.exec_()
and the attached outcomes: the green arrows drawn by hand shows where the circles used as markers and their associated text labels are clipped by the plot boundary. So it seems PythonQwt only make the curve fits but not the rest. I would consider that a bug but then is there a way to work around it?
Metadata
Metadata
Assignees
Labels
No labels