modusa 0.3.53__py3-none-any.whl → 0.3.56__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 CHANGED
@@ -72,7 +72,14 @@ class Fig:
72
72
 
73
73
  return colors[self._curr_color_idx]
74
74
 
75
- def _calculate_extent(self, x, y):
75
+ def _calculate_extent(self, x, y, o):
76
+ """
77
+
78
+ Parameters
79
+ ----------
80
+ o: str
81
+ - Origin
82
+ """
76
83
  # Handle spacing safely
77
84
  if len(x) > 1:
78
85
  dx = x[1] - x[0]
@@ -83,7 +90,10 @@ class Fig:
83
90
  else:
84
91
  dy = 1 # Default spacing for single value
85
92
 
86
- return [x[0] - dx / 2, x[-1] + dx / 2, y[0] - dy / 2, y[-1] + dy / 2]
93
+ if o == "lower":
94
+ return [x[0] - dx / 2, x[-1] + dx / 2, y[0] - dy / 2, y[-1] + dy / 2]
95
+ else:
96
+ return [x[0] - dx / 2, x[-1] + dx / 2, y[-1] + dy / 2, y[0] - dy / 2]
87
97
 
88
98
 
89
99
  def _generate_subplots(self, arrangement):
@@ -203,7 +213,7 @@ class Fig:
203
213
 
204
214
  if ylim is not None: curr_row[0].set_ylim(ylim)
205
215
 
206
- def add_matrix(self, M, y=None, x=None, c="gray_r", o="lower", label=None, ylabel=None, ylim=None, cbar=True, ax=None):
216
+ def add_matrix(self, M, y=None, x=None, c="gray_r", o="upper", label=None, ylabel=None, ylim=None, cbar=True, ax=None):
207
217
  """
208
218
  Add matrix to the figure.
209
219
 
@@ -248,12 +258,18 @@ class Fig:
248
258
 
249
259
  curr_row = self._get_curr_row() if ax is None else self._axs[ax]
250
260
 
251
- extent = self._calculate_extent(x, y)
261
+ extent = self._calculate_extent(x, y, o)
262
+ print(extent)
263
+
252
264
  im = curr_row[0].imshow(M, aspect="auto", origin=o, cmap=c, extent=extent)
253
265
 
254
266
  if ylabel is not None: curr_row[0].set_ylabel(ylabel)
255
267
 
256
- if ylim is not None: curr_row[0].set_ylim(ylim)
268
+ if ylim is not None:
269
+ if o == "lower":
270
+ curr_row[0].set_ylim(ylim)
271
+ elif o == "upper":
272
+ curr_row[0].set_ylim(ylim[::-1])
257
273
 
258
274
  if cbar is True:
259
275
  cbar = plt.colorbar(im, cax=curr_row[1])
@@ -445,8 +461,11 @@ class Fig:
445
461
  if xlabel is not None:
446
462
  ref_ax.set_xlabel(xlabel, size=s)
447
463
 
448
- def add_xticks():
449
- raise NotImplementedError("Please raise a github issue `https://github.com/meluron-toolbox/modusa/issues`")
464
+ def add_xticks(self, xticks=None):
465
+ """
466
+ Not implemented yet
467
+ """
468
+ raise NotImplementedError("Please raise a github issue https://github.com/meluron-toolbox/modusa/issues")
450
469
 
451
470
  def save(self, path="./figure.png"):
452
471
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modusa
3
- Version: 0.3.53
3
+ Version: 0.3.56
4
4
  Summary: A modular signal analysis python library.
5
5
  Author-Email: Ankit Anand <ankit0.anand0@gmail.com>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
- modusa-0.3.53.dist-info/METADATA,sha256=hiJs3x9W5XEj9aBYaje0gwt5imC6tnc54MKBd221MFo,1436
2
- modusa-0.3.53.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- modusa-0.3.53.dist-info/entry_points.txt,sha256=fmKpleVXj6CdaBVL14WoEy6xx7JQCs85jvzwTi3lePM,73
4
- modusa-0.3.53.dist-info/licenses/LICENSE.md,sha256=JTaXAjx5awk76VArKCx5dUW8vmLEWsL_ZlR7-umaHbA,1078
1
+ modusa-0.3.56.dist-info/METADATA,sha256=n_8ejSivvs_MZXpNqtMcwyIqu94G6TnxcE9V49BLdHo,1436
2
+ modusa-0.3.56.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ modusa-0.3.56.dist-info/entry_points.txt,sha256=fmKpleVXj6CdaBVL14WoEy6xx7JQCs85jvzwTi3lePM,73
4
+ modusa-0.3.56.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=sMJ0PfiRwfw_dUVTLtH1Oed4lOiwR06foAlDljhh3QA,16911
53
+ modusa/tools/plotter.py,sha256=wNiDmAawvrET9021YiZG_kbOACFu25TdzywtMLYhpa0,17232
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.53.dist-info/RECORD,,
62
+ modusa-0.3.56.dist-info/RECORD,,