customize legend style
This commit is contained in:
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user