diff --git a/graph.py b/graph.py index 6e77f7b..1788f2e 100644 --- a/graph.py +++ b/graph.py @@ -1,12 +1,16 @@ from spsa import Param import matplotlib.pyplot as plt - +from cycler import cycler class Graph: def __init__(self): self.time: list[int] = [] self.history: list[list[Param]] = [] + prop_cycle = plt.rcParams['axes.prop_cycle'] + colors = prop_cycle.by_key()['color'] + plt.rc('axes', prop_cycle=cycler('linestyle', ['-','--',':','-.']) * cycler('color', colors)) + def update(self, time: list[int], params: list[Param]): self.time.append(time) self.history.append(params) diff --git a/requirements.txt b/requirements.txt index 1573235..16b6191 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -matplotlib==3.5.1 \ No newline at end of file +matplotlib==3.5.1 +cycler==0.12.1 \ No newline at end of file