From 8e837d2f5174a96a271814fe678724b0d644520c Mon Sep 17 00:00:00 2001 From: nfaltermeier Date: Sat, 14 Mar 2026 01:01:20 -0500 Subject: [PATCH] Use linestyle to disambiguate params 11 and up in the graph --- graph.py | 6 +++++- requirements.txt | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) 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