phasorpy 0.6__cp313-cp313-win_amd64.whl → 0.8__cp313-cp313-win_amd64.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.
@@ -66,10 +66,15 @@ def plot_phasor(
66
66
  show : bool, optional, default: True
67
67
  Display figure.
68
68
  **kwargs
69
- Additional parguments passed to :py:class:`PhasorPlot`,
69
+ Optional arguments passed to :py:class:`PhasorPlot`,
70
70
  :py:meth:`PhasorPlot.plot`, :py:meth:`PhasorPlot.hist2d`, or
71
71
  :py:meth:`PhasorPlot.contour` depending on `style`.
72
72
 
73
+ Raises
74
+ ------
75
+ ValueError
76
+ If style is not one of 'plot', 'hist2d', or 'contour'.
77
+
73
78
  See Also
74
79
  --------
75
80
  phasorpy.plot.PhasorPlot
@@ -87,6 +92,7 @@ def plot_phasor(
87
92
  'xticks',
88
93
  'yticks',
89
94
  'grid',
95
+ 'pad',
90
96
  )
91
97
 
92
98
  real = numpy.asanyarray(real)
@@ -153,7 +159,7 @@ def plot_phasor_image(
153
159
  show : bool, optional, default: True
154
160
  Display figure.
155
161
  **kwargs
156
- Additional arguments passed to :func:`matplotlib.pyplot.imshow`.
162
+ Optional arguments passed to :func:`matplotlib.pyplot.imshow`.
157
163
 
158
164
  Raises
159
165
  ------
@@ -321,7 +327,7 @@ def plot_signal_image(
321
327
  show : bool, optional, default: True
322
328
  Display figure.
323
329
  **kwargs
324
- Additional arguments passed to :func:`matplotlib.pyplot.imshow`.
330
+ Optional arguments passed to :func:`matplotlib.pyplot.imshow`.
325
331
 
326
332
  Raises
327
333
  ------
@@ -426,7 +432,7 @@ def plot_image(
426
432
  show : bool, optional, default: True
427
433
  Display figure.
428
434
  **kwargs
429
- Additional arguments passed to :func:`matplotlib.pyplot.imshow`.
435
+ Optional arguments passed to :func:`matplotlib.pyplot.imshow`.
430
436
 
431
437
  Raises
432
438
  ------
@@ -572,7 +578,7 @@ def plot_polar_frequency(
572
578
  show : bool, optional, default: True
573
579
  Display figure.
574
580
  **kwargs
575
- Additional arguments passed to :py:func:`matplotlib.pyplot.plot`.
581
+ Optional arguments passed to :py:func:`matplotlib.pyplot.plot`.
576
582
 
577
583
  """
578
584
  # TODO: make this customizable: labels, colors, ...
@@ -619,7 +625,7 @@ def plot_histograms(
619
625
 
620
626
  Parameters
621
627
  ----------
622
- data: array_like
628
+ *data : array_like
623
629
  Data arrays to be plotted as histograms.
624
630
  title : str, optional
625
631
  Figure title.
@@ -632,7 +638,7 @@ def plot_histograms(
632
638
  show : bool, optional, default: True
633
639
  Display figure.
634
640
  **kwargs
635
- Additional arguments passed to :func:`matplotlib.pyplot.hist`.
641
+ Optional arguments passed to :func:`matplotlib.pyplot.hist`.
636
642
 
637
643
  """
638
644
  ax = pyplot.subplots()[1]
@@ -17,16 +17,18 @@ from matplotlib.lines import Line2D
17
17
  from matplotlib.widgets import Slider
18
18
 
19
19
  from .._utils import update_kwargs
20
- from ..phasor import (
20
+ from ..lifetime import (
21
21
  lifetime_to_frequency,
22
22
  lifetime_to_signal,
23
23
  phasor_from_lifetime,
24
+ )
25
+ from ..phasor import (
24
26
  phasor_to_polar,
25
27
  phasor_transform,
26
28
  )
27
29
  from ..plot._phasorplot import (
30
+ CircleTicks,
28
31
  PhasorPlot,
29
- SemicircleTicks,
30
32
  _semicircle_ticks,
31
33
  )
32
34
 
@@ -60,7 +62,7 @@ class LifetimePlots:
60
62
  If True, add sliders to change frequency and lifetimes interactively.
61
63
  Default is False.
62
64
  **kwargs:
63
- Additional arguments passed to matplotlib figure.
65
+ Optional arguments passed to matplotlib figure.
64
66
 
65
67
  """
66
68
 
@@ -91,7 +93,7 @@ class LifetimePlots:
91
93
  _modulation_lines: list[Line2D]
92
94
 
93
95
  _semicircle_line: Line2D
94
- _semicircle_ticks: SemicircleTicks | None
96
+ _semicircle_ticks: CircleTicks | None
95
97
 
96
98
  _component_colors = (
97
99
  # 'tab:blue', # main
@@ -167,7 +169,12 @@ class LifetimePlots:
167
169
  time_plot.set_xlabel('Time [ns]')
168
170
  time_plot.set_ylabel('Intensity [normalized]')
169
171
  lines = time_plot.plot(
170
- times, signal, label='Signal', color='tab:blue', lw=2, zorder=10
172
+ times,
173
+ signal,
174
+ label='Signal',
175
+ color='tab:blue',
176
+ linewidth=2,
177
+ zorder=10,
171
178
  )
172
179
  self._signal_lines.append(lines[0])
173
180
  if num_components > 1:
@@ -177,7 +184,7 @@ class LifetimePlots:
177
184
  component_signal[i],
178
185
  label=f'Lifetime {i}',
179
186
  color=self._component_colors[i],
180
- lw=0.8,
187
+ linewidth=0.8,
181
188
  alpha=0.5,
182
189
  )
183
190
  self._signal_lines.append(lines[0])
@@ -186,7 +193,7 @@ class LifetimePlots:
186
193
  irf,
187
194
  label='Instrument response',
188
195
  color='tab:grey',
189
- lw=0.8,
196
+ linewidth=0.8,
190
197
  alpha=0.5,
191
198
  )
192
199
  self._signal_lines.append(lines[0])
@@ -204,11 +211,11 @@ class LifetimePlots:
204
211
  if num_components > 1:
205
212
  for i in range(num_components):
206
213
  lines = phasorplot.plot(
207
- [real, component_real[i]],
208
- [imag, component_imag[i]],
214
+ (real, component_real[i]),
215
+ (imag, component_imag[i]),
209
216
  color=self._component_colors[i],
210
- ls='-',
211
- lw=0.8,
217
+ linestyle='-',
218
+ linewidth=0.8,
212
219
  alpha=0.5,
213
220
  )
214
221
  self._phasor_lines.append(lines[0])
@@ -225,14 +232,14 @@ class LifetimePlots:
225
232
  phase_plot.set_xscale('log', base=10)
226
233
  phase_plot.set_xlabel('Frequency (MHz)')
227
234
  phase_plot.set_ylabel('Phase (°)', color='tab:blue')
228
- phase_plot.set_yticks([0.0, 30.0, 60.0, 90.0])
229
- phase_plot.plot([1, 1], [0.0, 90.0], alpha=0.0) # set autoscale
235
+ phase_plot.set_yticks((0.0, 30.0, 60.0, 90.0))
236
+ phase_plot.plot((1, 1), (0.0, 90.0), alpha=0.0) # set autoscale
230
237
  lines = phase_plot.plot(
231
- [frequency, frequency],
232
- [0, 90],
238
+ (frequency, frequency),
239
+ (0, 90),
233
240
  '--',
234
241
  color='gray',
235
- lw=0.8,
242
+ linewidth=0.8,
236
243
  alpha=0.5,
237
244
  )
238
245
  self._frequency_line = lines[0]
@@ -241,7 +248,7 @@ class LifetimePlots:
241
248
  )
242
249
  self._phase_point = lines[0]
243
250
  lines = phase_plot.plot(
244
- self._frequencies, phase_, color='tab:blue', lw=2, zorder=2
251
+ self._frequencies, phase_, color='tab:blue', linewidth=2, zorder=2
245
252
  )
246
253
  self._phase_lines.append(lines[0])
247
254
  if num_components > 1:
@@ -250,7 +257,7 @@ class LifetimePlots:
250
257
  self._frequencies,
251
258
  component_phase_[i],
252
259
  color=self._component_colors[i],
253
- lw=0.5,
260
+ linewidth=0.5,
254
261
  alpha=0.5,
255
262
  )
256
263
  self._phase_lines.append(lines[0])
@@ -260,14 +267,18 @@ class LifetimePlots:
260
267
  # twinx modulation_plot is always plotted on top of phase_plot
261
268
  modulation_plot = phase_plot.twinx()
262
269
  modulation_plot.set_ylabel('Modulation (%)', color='tab:red')
263
- modulation_plot.set_yticks([0.0, 25.0, 50.0, 75.0, 100.0])
264
- modulation_plot.plot([1, 1], [0.0, 100.0], alpha=0.0) # set autoscale
270
+ modulation_plot.set_yticks((0.0, 25.0, 50.0, 75.0, 100.0))
271
+ modulation_plot.plot((1, 1), (0.0, 100.0), alpha=0.0) # set autoscale
265
272
  lines = modulation_plot.plot(
266
273
  frequency, modulation, 'o', color='tab:red', markersize=8, zorder=2
267
274
  )
268
275
  self._modulation_point = lines[0]
269
276
  lines = modulation_plot.plot(
270
- self._frequencies, modulation_, color='tab:red', lw=2, zorder=2
277
+ self._frequencies,
278
+ modulation_,
279
+ color='tab:red',
280
+ linewidth=2,
281
+ zorder=2,
271
282
  )
272
283
  self._modulation_lines.append(lines[0])
273
284
  if num_components > 1:
@@ -276,7 +287,7 @@ class LifetimePlots:
276
287
  self._frequencies,
277
288
  component_modulation_[i],
278
289
  color=self._component_colors[i],
279
- lw=0.5,
290
+ linewidth=0.5,
280
291
  alpha=0.5,
281
292
  )
282
293
  self._modulation_lines.append(lines[0])
@@ -520,8 +531,7 @@ class LifetimePlots:
520
531
  [real, component_real[i]], [imag, component_imag[i]]
521
532
  )
522
533
  self._phasor_points[i + 1].set_data(
523
- [component_real[i]],
524
- [component_imag[i]],
534
+ [component_real[i]], [component_imag[i]]
525
535
  )
526
536
 
527
537
  # frequency domain plot