I have a PlotDataItem that form a closed polygon, and I would like to fill the interior area with some color other than the background, or perhaps with some other QBrush. How to achieve this? FillBetweenItem does not seem to cover this case.
--
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 pyqtgraph+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/86fe0a56-85cc-4d19-9149-3b69bedc0081%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
File "/usr/lib/python3/dist-packages/pyqtgraph/widgets/PlotWidget.py", line 75, in __getattr__
if hasattr(self.plotItem, attr):
[Previous line repeated 325 more times]
RecursionError: maximum recursion depth exceeded
Qt provides several lower-level drawing primitives. In this case, you probably want QGraphicsPathItem: http://doc.qt.io/archives/qt-4.8/qgraphicspathitem.htmlYou could also use pg.arrayToQPath to generate the QPath: http://www.pyqtgraph.org/documentation/functions.html#pyqtgraph.arrayToQPath
On May 12, 2018 4:48 AM, "Robert Budzyński" <dr.b...@gmail.com> wrote:
I have a PlotDataItem that form a closed polygon, and I would like to fill the interior area with some color other than the background, or perhaps with some other QBrush. How to achieve this? FillBetweenItem does not seem to cover this case.
--
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 pyqtgraph+...@googlegroups.com.
Qt provides several lower-level drawing primitives. In this case, you probably want QGraphicsPathItem: http://doc.qt.io/archives/qt-4.8/qgraphicspathitem.htmlYou could also use pg.arrayToQPath to generate the QPath: http://www.pyqtgraph.org/documentation/functions.html#pyqtgraph.arrayToQPath
--
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 pyqtgraph+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/6f927042-b73a-4d4e-ac81-4b7e084d8a8e%40googlegroups.com.
Text can be added anywhere in much the same way, with QGraphicsTextItem. The important thing here, though, is that you do not want to add the text into the viewbox like you did with the path (because you don't want the text to scale/translate with the view). Instead, make the ViewBox or PlotItem the parent of the text item. For example:4. Probably you will also need to set the pen/brush on the QGraphicsPathItem3. Add the QGraphicsPathItem to the ViewBox or PlotItem2. Create a QGraphicsPathItem using the QPainterPath as its inputNo need to do any manual painting. To be more specific:1. Use arrayToQPath to generate a QPainterPath object (this describes just the coordinates of lines in the path)
plt = pg.plot()
text = pg.QtGui.QGraphicsTextItem("Hello")
text.setDefaultTextColor(pg.mkColor('w'))
text.setParentItem(plt.plotItem) # this is not the same as plt.plotItem.addItem(text)
On Mon, May 14, 2018 at 8:55 AM, Robert Budzyński <dr.b...@gmail.com> wrote:
On Saturday, May 12, 2018 at 7:28:02 PM UTC+2, Luke Campagnola wrote:Qt provides several lower-level drawing primitives. In this case, you probably want QGraphicsPathItem: http://doc.qt.io/archives/qt-4.8/qgraphicspathitem.htmlYou could also use pg.arrayToQPath to generate the QPath: http://www.pyqtgraph.org/documentation/functions.html#pyqtgraph.arrayToQPathMore specifically, this QPainterPath should be painted on some QWidget, and I can't figure out which. My guess was the ViewBox, but I get:TypeError: arguments did not match any overloaded call:
QPainter(): too many arguments
QPainter(QPaintDevice): argument 1 has unexpected type 'ViewBox'
--
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 pyqtgraph+...@googlegroups.com.
clabel = pg.LabelItem('some text...', justify='right')
widget.plotItem.layout.addItem(clabel, 4, 1)