Skip to content

Commit

Permalink
fixed matplotlib private method removed, removed outdated README in t…
Browse files Browse the repository at this point in the history
…ests folder
  • Loading branch information
rikigigi committed Dec 27, 2024
1 parent 0f9d20a commit daf9fa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
18 changes: 8 additions & 10 deletions sportran/plotter/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ def plot_cospectrum_component(current, idx1, idx2, *, axis=None, FIGSIZE=None, f
"""
if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color1 = next(axis._get_lines.prop_cycler)['color']
color2 = next(axis._get_lines.prop_cycler)['color']
axis.plot(current.freqs_THz, np.real(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5, c=color1)
axis.plot(current.freqs_THz, np.imag(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5, c=color2)
axis.plot(current.freqs_THz, np.real(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5)
axis.plot(current.freqs_THz, np.imag(current.fcospectrum[idx1][idx2]) * current.KAPPA_SCALE * 0.5)

if f_THz_max is None:
f_THz_max = current.freqs_THz[_index_cumsum(np.abs(current.fcospectrum[idx1][idx2]), 0.95)]
Expand Down Expand Up @@ -191,8 +189,8 @@ def plot_ck(current, *, axis=None, label=None, FIGSIZE=None):

if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color = next(axis._get_lines.prop_cycler)['color']
axis.plot(current.cepf.logpsdK, 'o-', c=color, label=label)
l, = axis.plot(current.cepf.logpsdK, 'o-', label=label)
color = l.get_color()

axis.plot(current.cepf.logpsdK + current.cepf.logpsdK_THEORY_std, '--', c=color)
axis.plot(current.cepf.logpsdK - current.cepf.logpsdK_THEORY_std, '--', c=color)
Expand All @@ -215,8 +213,8 @@ def plot_L0_Pstar(current, *, axis=None, label=None, FIGSIZE=None):
"""
if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color = next(axis._get_lines.prop_cycler)['color']
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau, '.-', c=color, label=label)
l, = axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau, '.-', label=label)
color = l.get_color()
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau + current.cepf.logtau_THEORY_std, '--', c=color)
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.logtau - current.cepf.logtau_THEORY_std, '--', c=color)
axis.axvline(x=current.cepf.aic_Kmin + 1, ls=':', c=color)
Expand Down Expand Up @@ -245,11 +243,11 @@ def plot_kappa_Pstar(current, *, axis=None, label=None, FIGSIZE=None, pstar_max=
"""
if axis is None:
figure, axis = plt.subplots(1, figsize=FIGSIZE)
color = next(axis._get_lines.prop_cycler)['color']
l, = axis.plot(np.arange(current.NFREQS) + 1, current.cepf.tau * current.KAPPA_SCALE * 0.5, 'o-', label=label)
color = l.get_color()
axis.fill_between(
np.arange(current.NFREQS) + 1, (current.cepf.tau - current.cepf.tau_THEORY_std) * current.KAPPA_SCALE * 0.5,
(current.cepf.tau + current.cepf.tau_THEORY_std) * current.KAPPA_SCALE * 0.5, alpha=0.3, color=color)
axis.plot(np.arange(current.NFREQS) + 1, current.cepf.tau * current.KAPPA_SCALE * 0.5, 'o-', c=color, label=label)
axis.axvline(x=current.cepf.aic_Kmin + 1, ls=':', c=color)
axis.axvline(x=current.cepf.cutoffK + 1, ls='--', c=color)
axis.axhline(y=current.kappa, ls='--', c=color)
Expand Down
3 changes: 0 additions & 3 deletions tests/README.md

This file was deleted.

0 comments on commit daf9fa5

Please sign in to comment.