made line/marker colors arguments to pg_plot_style; added LINE_STYLES and LINE_STYLE_CYCLE

This commit is contained in:
2023-01-08 13:15:43 +01:00
parent a1374004dc
commit 3eb635a0d8

View File

@ -90,17 +90,17 @@ def apply_pg():
pg.setConfigOption("background", GREY0)
def pg_plot_style():
def pg_plot_style(line_color=DOT_PEN, marker_stroke_color=DOT_PEN, marker_fill_color=DOT_BRUSH):
pen = pg.mkPen(
DOT_PEN,
line_color,
width=3
)
style = dict(
pen=pen,
symbol="o",
symbolPen=DOT_PEN,
symbolBrush=DOT_BRUSH,
symbolPen=marker_stroke_color,
symbolBrush=marker_fill_color,
symbolSize=DOT_SIZE
)
@ -108,3 +108,11 @@ def pg_plot_style():
from itertools import cycle
LINE_STYLES = (pg_plot_style(line_color=c, marker_fill_color=c) for c in LINE_COLORS)
LINE_STYLE_CYCLE = cycle(LINE_STYLES)