(self,
unique_keys: list,
pos_markers: list = None,
cmap = None,
linewidth: float = 4
)
| 90 | |
| 91 | class RollingLineFormats: |
| 92 | def __init__(self, |
| 93 | unique_keys: list, |
| 94 | pos_markers: list = None, |
| 95 | cmap = None, |
| 96 | linewidth: float = 4 |
| 97 | ): |
| 98 | print(unique_keys) |
| 99 | if pos_markers is None: |
| 100 | pos_markers = ['-', '--', ':', '-', '-.'] |
| 101 | if cmap is None: |
| 102 | cmap = plt.get_cmap('viridis') |
| 103 | cs = ['#1f77b4', '#ff7f0e', '#2ca02c', '#9467bd', '#8c564b', |
| 104 | '#e377c2', '#7f7f7f', '#d62728', '#bcbd22', '#17becf'] |
| 105 | # cs = plt.rcParams['axes.prop_cycle'].by_key()['color'] |
| 106 | |
| 107 | self.pos_markers = pos_markers |
| 108 | # self.cmaps = {key: cmap(i/len(unique_keys)) for i, key in enumerate(unique_keys)} |
| 109 | self.cmaps = {key: cs[i] for i, key in enumerate(unique_keys)} |
| 110 | self.pos_per_key = {key: 0 for key in unique_keys} # lower makes lines too white |
| 111 | self.lws = {key: linewidth for key in unique_keys} |
| 112 | |
| 113 | def __getitem__(self, key): |
| 114 | cur_i = self.pos_per_key[key] |
nothing calls this directly
no outgoing calls
no test coverage detected