My apologies, please ignore the previous messages with this subject - turns out 
this was just me being an idiot. The documentation CLEARLY states that the 
QPainterPath needs to be “centered at 0,0” and with a width and height of 1. 
The entire problem was how I was specifying the QPainterPath. Sorry for the 
noise!
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

> On Apr 7, 2022, at 1:46 PM, Israel Brewster <[email protected]> wrote:
> 
> 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?
> 
> Example code:
> 
> 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
> Work: 907-474-5172
> cell:  907-328-9145
> 

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/0347E5EC-1D03-4790-BE52-C3832506189E%40alaska.edu.

Reply via email to