I’m not sure if this is a bug or something I am not understanding/doing wrong, but it seems that if I specify the symbol for a plot as a QPainterPath, when plotted with pxMode = True the shape/content of the QPainterPath is ignored and the plot is created using squares. With pxMode=False, the plot is drawn correctly. Am I just missing something?
from PySide2.QtGui import QPainterPath
from PySide2.QtWidgets import QApplication, QDialog, QVBoxLayout, QLabel
import pyqtgraph as pg
if __name__ == "__main__":
print(pg.__version__)
app = QApplication()
dialog = QDialog()
dialog.setWindowTitle("Zoom tests")
layout = QVBoxLayout(dialog)
circle_path = QPainterPath()
circle_path.addEllipse(-1, -1, 2, 2)
xvals = list(range(10))
yvals = list(range(10))
# Grid on right axis, zoom point significantly offset
plotWidget = pg.PlotWidget(dialog)
plotWidget.plot(xvals, yvals,
symbol = circle_path,
symbolBrush = "#F00",
symbolPen = None,
pen = None,
symbolSize = .5,
pxMode = False)
plotWidget2 = pg.PlotWidget(dialog)
plotWidget2.plot(xvals, yvals,
symbol = circle_path,
symbolBrush = "#F00",
symbolPen = None,
pen = None,
symbolSize = 50,
pxMode = True)
layout.addWidget(QLabel("Pixel Mode On"))
layout.addWidget(plotWidget)
layout.addWidget(QLabel("Pixel Mode Off"))
layout.addWidget(plotWidget2)
dialog.show()
app.exec_()
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory
Geophysical Institute - UAF
2156 Koyukuk Drive
Fairbanks AK 99775-7320