modusa 0.3.70__py3-none-any.whl → 0.3.71__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modusa/tools/plotter.py +33 -19
- {modusa-0.3.70.dist-info → modusa-0.3.71.dist-info}/METADATA +1 -1
- {modusa-0.3.70.dist-info → modusa-0.3.71.dist-info}/RECORD +6 -6
- {modusa-0.3.70.dist-info → modusa-0.3.71.dist-info}/WHEEL +0 -0
- {modusa-0.3.70.dist-info → modusa-0.3.71.dist-info}/entry_points.txt +0 -0
- {modusa-0.3.70.dist-info → modusa-0.3.71.dist-info}/licenses/LICENSE.md +0 -0
modusa/tools/plotter.py
CHANGED
|
@@ -60,12 +60,9 @@ class Fig:
|
|
|
60
60
|
dark_mode: bool
|
|
61
61
|
- Do you want dark mode?
|
|
62
62
|
- Default: True
|
|
63
|
-
grid: bool
|
|
64
|
-
- Do you want the grid?
|
|
65
|
-
- Default: True
|
|
66
63
|
"""
|
|
67
64
|
|
|
68
|
-
def __init__(self, arrangement="asm", xlim=None, width=16, dark_mode=True
|
|
65
|
+
def __init__(self, arrangement="asm", xlim=None, width=16, dark_mode=True):
|
|
69
66
|
|
|
70
67
|
if dark_mode:
|
|
71
68
|
plt.style.use("dark_background")
|
|
@@ -83,7 +80,6 @@ class Fig:
|
|
|
83
80
|
self._xlim = xlim
|
|
84
81
|
self._curr_row_idx = 1 # Starting from 1 because row 0 is reserved for reference subplot
|
|
85
82
|
self._curr_color_idx = 0 # So that we have different color across all the subplots to avoid legend confusion
|
|
86
|
-
self._grid = grid
|
|
87
83
|
|
|
88
84
|
# Subplot setup
|
|
89
85
|
self._fig, self._axs = self._generate_subplots(arrangement, width) # This will fill in the all the above variables
|
|
@@ -138,7 +134,6 @@ class Fig:
|
|
|
138
134
|
"""
|
|
139
135
|
|
|
140
136
|
xlim = self._xlim
|
|
141
|
-
grid: bool = self._grid
|
|
142
137
|
fig_width = width
|
|
143
138
|
|
|
144
139
|
n_aux_sp = arrangement.count("a")
|
|
@@ -172,17 +167,11 @@ class Fig:
|
|
|
172
167
|
axs[i, 1].axis("off")
|
|
173
168
|
elif char == "a": # Remove ticks and labels from all the aux subplots
|
|
174
169
|
axs[i, 0].tick_params(left=False, bottom=False, labelleft=False, labelbottom=False)
|
|
175
|
-
if grid:
|
|
176
|
-
axs[i, 0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
177
170
|
axs[i, 1].axis("off")
|
|
178
171
|
elif char == "s":
|
|
179
172
|
axs[i, 0].tick_params(bottom=False, labelbottom=False)
|
|
180
|
-
if grid:
|
|
181
|
-
axs[i, 0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
182
173
|
axs[i, 1].axis("off")
|
|
183
174
|
elif char == "m":
|
|
184
|
-
if grid:
|
|
185
|
-
axs[i, 0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
186
175
|
axs[i, 0].tick_params(bottom=False, labelbottom=False)
|
|
187
176
|
|
|
188
177
|
axs[i, 0].sharex(axs[0, 0])
|
|
@@ -197,7 +186,7 @@ class Fig:
|
|
|
197
186
|
|
|
198
187
|
return fig, axs
|
|
199
188
|
|
|
200
|
-
def add_signal(self, y, x=None, c=None, ls=None, lw=None, m=None, ms=3, label=None, ylabel=None, ylim=None, yticks=None, yticklabels=None, xticks=None, xticklabels=None, ax=None):
|
|
189
|
+
def add_signal(self, y, x=None, c=None, ls=None, lw=None, m=None, ms=3, label=None, ylabel=None, ylim=None, yticks=None, yticklabels=None, xticks=None, xticklabels=None, grid=True, ax=None):
|
|
201
190
|
"""
|
|
202
191
|
Add signal to the figure.
|
|
203
192
|
|
|
@@ -241,6 +230,9 @@ class Fig:
|
|
|
241
230
|
- Positions at which to place x-axis ticks.
|
|
242
231
|
xticklabels : list of str, optional
|
|
243
232
|
- Labels corresponding to `xticks`. Must be the same length as `xticks`.
|
|
233
|
+
grid: bool
|
|
234
|
+
- Do you want the grid?
|
|
235
|
+
- Default: True
|
|
244
236
|
ax: int
|
|
245
237
|
- Which specific axis to plot (1, 2, 3, ...)
|
|
246
238
|
- None
|
|
@@ -275,9 +267,12 @@ class Fig:
|
|
|
275
267
|
curr_row[0].set_xticks(xticks)
|
|
276
268
|
if xticklabels is not None:
|
|
277
269
|
curr_row[0].set_xticklabels(xticklabels)
|
|
270
|
+
|
|
271
|
+
if grid is True:
|
|
272
|
+
curr_row[0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
278
273
|
|
|
279
274
|
|
|
280
|
-
def add_matrix(self, M, y=None, x=None, c="gray_r", o="upper", label=None, ylabel=None, ylim=None, yticks=None, yticklabels=None, xticks=None, xticklabels=None, cbar=True, ax=None):
|
|
275
|
+
def add_matrix(self, M, y=None, x=None, c="gray_r", o="upper", label=None, ylabel=None, ylim=None, yticks=None, yticklabels=None, xticks=None, xticklabels=None, cbar=True, grid=True, ax=None):
|
|
281
276
|
"""
|
|
282
277
|
Add matrix to the figure.
|
|
283
278
|
|
|
@@ -317,6 +312,9 @@ class Fig:
|
|
|
317
312
|
cbar: bool
|
|
318
313
|
- Show colorbar
|
|
319
314
|
- Default: True
|
|
315
|
+
grid: bool
|
|
316
|
+
- Do you want the grid?
|
|
317
|
+
- Default: True
|
|
320
318
|
ax: int
|
|
321
319
|
- Which specific axis to plot (1, 2, 3, ...)
|
|
322
320
|
- None
|
|
@@ -357,8 +355,12 @@ class Fig:
|
|
|
357
355
|
if xticklabels is not None:
|
|
358
356
|
curr_row[0].set_xticklabels(xticklabels)
|
|
359
357
|
|
|
358
|
+
if grid is True:
|
|
359
|
+
curr_row[0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
360
|
+
|
|
361
|
+
|
|
360
362
|
|
|
361
|
-
def add_events(self, events, c=None, ls=None, lw=None, label=None, ax=None):
|
|
363
|
+
def add_events(self, events, c=None, ls=None, lw=None, label=None, grid=True, ax=None):
|
|
362
364
|
"""
|
|
363
365
|
Add events to the figure.
|
|
364
366
|
|
|
@@ -379,6 +381,9 @@ class Fig:
|
|
|
379
381
|
- Label for the event type.
|
|
380
382
|
- This will appear in the legend.
|
|
381
383
|
- Default: None
|
|
384
|
+
grid: bool
|
|
385
|
+
- Do you want the grid?
|
|
386
|
+
- Default: True
|
|
382
387
|
ax: int
|
|
383
388
|
- Which specific axis to plot (1, 2, 3, ...)
|
|
384
389
|
- None
|
|
@@ -407,7 +412,10 @@ class Fig:
|
|
|
407
412
|
else:
|
|
408
413
|
curr_row[0].axvline(x=event, color=c, linestyle=ls, linewidth=lw)
|
|
409
414
|
|
|
410
|
-
|
|
415
|
+
if grid is True:
|
|
416
|
+
curr_row[0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
417
|
+
|
|
418
|
+
def add_annotation(self, ann, label=None, patterns=None, ylim=(0, 1), text_loc="middle", grid=True, ax=None):
|
|
411
419
|
"""
|
|
412
420
|
Add annotation to the figure.
|
|
413
421
|
|
|
@@ -424,15 +432,18 @@ class Fig:
|
|
|
424
432
|
- Patterns to group annotations
|
|
425
433
|
- E.g., "*R" or "<tag>*" or ["A*", "*B"]
|
|
426
434
|
- All elements in a group will have same color.
|
|
427
|
-
ax: int
|
|
428
|
-
- Which specific axis to plot (1, 2, 3, ...)
|
|
429
|
-
- None
|
|
430
435
|
ylim: tuple[number, number]
|
|
431
436
|
- Y-limit for the annotation.
|
|
432
437
|
- Default: (0, 1)
|
|
433
438
|
text_loc: str
|
|
434
439
|
- Location of text relative to the box. (b for bottom, m for middle, t for top)
|
|
435
440
|
- Default: "middle"
|
|
441
|
+
grid: bool
|
|
442
|
+
- Do you want the grid?
|
|
443
|
+
- Default: True
|
|
444
|
+
ax: int
|
|
445
|
+
- Which specific axis to plot (1, 2, 3, ...)
|
|
446
|
+
- None
|
|
436
447
|
Returns
|
|
437
448
|
-------
|
|
438
449
|
None
|
|
@@ -515,6 +526,9 @@ class Fig:
|
|
|
515
526
|
curr_row[0].set_ylabel(label, rotation=0, ha="center", va="center")
|
|
516
527
|
curr_row[0].yaxis.set_label_position("right")
|
|
517
528
|
curr_row[0].yaxis.set_label_coords(1.05, 0.75)
|
|
529
|
+
|
|
530
|
+
if grid is True:
|
|
531
|
+
curr_row[0].grid(True, linestyle='--', linewidth=0.7, color="lightgray" ,alpha=0.6)
|
|
518
532
|
|
|
519
533
|
def add_legend(self, ypos=1.0):
|
|
520
534
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
modusa-0.3.
|
|
2
|
-
modusa-0.3.
|
|
3
|
-
modusa-0.3.
|
|
4
|
-
modusa-0.3.
|
|
1
|
+
modusa-0.3.71.dist-info/METADATA,sha256=LR0dA8ReDc2Ii-DPSI-LITAowNq0748ohej3DwlDm5E,1436
|
|
2
|
+
modusa-0.3.71.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
|
3
|
+
modusa-0.3.71.dist-info/entry_points.txt,sha256=fmKpleVXj6CdaBVL14WoEy6xx7JQCs85jvzwTi3lePM,73
|
|
4
|
+
modusa-0.3.71.dist-info/licenses/LICENSE.md,sha256=JTaXAjx5awk76VArKCx5dUW8vmLEWsL_ZlR7-umaHbA,1078
|
|
5
5
|
modusa/.DS_Store,sha256=_gm6qJREwfMi8dE7n5S89_RG46u5t3xHyD-smNhtNoM,6148
|
|
6
6
|
modusa/__init__.py,sha256=RMIKAZZ27w1oh2UFMJvZQtQ-SluIQsac_3mSK_LaM30,277
|
|
7
7
|
modusa/config.py,sha256=bTqK4t00FZqERVITrxW_q284aDDJAa9aMSfFknfR-oU,280
|
|
@@ -50,7 +50,7 @@ modusa/tools/audio_player.py,sha256=GP04TWW4jBwQBjANkfR_cJtEy7cIhvbu8RTwnf9hD6E,
|
|
|
50
50
|
modusa/tools/audio_recorder.py,sha256=d2fVt0Sd2tlBdb2WlUs60K4N23zuxM3KUpQqX0ifPi8,2769
|
|
51
51
|
modusa/tools/base.py,sha256=C0ESJ0mIfjjRlAkRbSetNtMoOfS6IrHBjexRp3l_Mh4,1293
|
|
52
52
|
modusa/tools/math_ops.py,sha256=ZZ7U4DgqT7cOeE7_Lzi_Qq-48WYfwR9_osbZwTmE9eg,8690
|
|
53
|
-
modusa/tools/plotter.py,sha256=
|
|
53
|
+
modusa/tools/plotter.py,sha256=kLSZmzw4AHAQXTSb8u1F_fA6sWCR9G6xHOuhD6UC_DE,21518
|
|
54
54
|
modusa/tools/youtube_downloader.py,sha256=hB_X8-7nOHXOlxg6vv3wyhBLoAsWyomrULP6_uCQL7s,1698
|
|
55
55
|
modusa/utils/.DS_Store,sha256=nLXMwF7QJNuglLI_Gk74F7vl5Dyus2Wd74Mgowijmdo,6148
|
|
56
56
|
modusa/utils/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
|
|
@@ -59,4 +59,4 @@ modusa/utils/excp.py,sha256=L9vhaGjKpv9viJYdmC9n5ndmk2GVbUBuFyZyhAQZmWY,906
|
|
|
59
59
|
modusa/utils/logger.py,sha256=K0rsnObeNKCxlNeSnVnJeRhgfmob6riB2uyU7h3dDmA,571
|
|
60
60
|
modusa/utils/np_func_cat.py,sha256=TyIFgRc6bARRMDnZxlVURO5Z0I-GWhxRONYyIv-Vwxs,1007
|
|
61
61
|
modusa/utils/plot.py,sha256=s_vNdxvKfwxEngvJPgrF1PcmxZNnNaaXPViHWjyjJ-c,5335
|
|
62
|
-
modusa-0.3.
|
|
62
|
+
modusa-0.3.71.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|