customize legend style

This commit is contained in:
2023-01-09 16:13:07 +01:00
parent e69f7d6bef
commit 469c9ee87c
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import pyqtgraph as pg
from .mdisubwin import MDISubWindow
from ..theme import pg_plot_style, pg_plot_style_cycler
from ..theme import pg_plot_style, pg_plot_style_cycler, pg_legend_style
class MDISubPlot(MDISubWindow):
@ -22,10 +22,11 @@ class MDISubMultiPlot(MDISubWindow):
name = " | ".join(names)
super().__init__(name, *args, **kwargs)
ls = pg_legend_style()
psc = pg_plot_style_cycler()
plt = pg.PlotWidget()
plt.addLegend()
plt.addLegend(**ls)
self.plots = [d.make_plot(plt, s) for d, s in zip(descs, psc)]
self.setWidget(plt)

View File

@ -113,4 +113,12 @@ def pg_plot_style_cycler(colors=LINE_COLORS):
return cycle(line_styles)
def pg_legend_style():
style = dict(
brush = GREY0,
pen = WHITE
)
return style