Figured it out. For those that want the same functionality I created a
class which inherits legenditem. Then p.setPen and p.setBrush can be
changed in order to get the desired legend.
from pyqtgraph import LegendItem
import pyqtgraph.functions as fn
class myLegend(LegendItem):
def __init__(self):
LegendItem.__init__(self)
def paint(self, p, *args):
p.setPen(fn.mkPen(255,0,0,100))
p.setBrush(fn.mkBrush(100,0,0,50))
p.drawRect(self.boundingRect())
On Monday, July 17, 2017 at 3:04:37 PM UTC-6, Patrick Kreitzberg wrote:
>
> Hi,
>
> I want to change the plot legend to have a solid white background, is this
> possible?
>
> Thanks
>
--
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/c2b848c3-a1ea-42d7-8921-26d6a430fae2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.