MCPcopy Create free account
hub / github.com/RolnickLab/climart / __init__

Method __init__

climart/utils/plotting.py:92–111  ·  view source on GitHub ↗
(self,
                 unique_keys: list,
                 pos_markers: list = None,
                 cmap = None,
                 linewidth: float = 4
                 )

Source from the content-addressed store, hash-verified

90
91class 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]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected