-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from neurodsp-tools/plts
Add Plotting Funcs
- Loading branch information
Showing
20 changed files
with
637 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
"""Plotting functions.""" | ||
|
||
from .time_series import plot_time_series, plot_bursts | ||
from .filt import plot_filter_properties, plot_frequency_response, plot_impulse_response | ||
from .rhythm import plot_swm_pattern, plot_lagged_coherence | ||
from .spectral import plot_power_spectra, plot_scv, plot_scv_rs_lines, plot_scv_rs_matrix, plot_spectral_hist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"""Plotting functions for neurodsp.rhythm.""" | ||
|
||
import matplotlib.pyplot as plt | ||
|
||
from neurodsp.plts.style import style_plot | ||
from neurodsp.plts.utils import check_ax, savefig | ||
|
||
################################################################################################### | ||
################################################################################################### | ||
|
||
@savefig | ||
@style_plot | ||
def plot_swm_pattern(pattern, ax=None): | ||
"""Plot the resulting pattern from a sliding window matching analysis. | ||
Parameters | ||
---------- | ||
pattern : 1d array | ||
The resulting average pattern from applying sliding window matching. | ||
ax : matplotlib.Axes, optional | ||
Figure axes upon which to plot. | ||
""" | ||
|
||
ax = check_ax(ax, (4, 4)) | ||
|
||
plt.plot(pattern, 'k') | ||
|
||
plt.title('Average Pattern') | ||
plt.xlabel('Time (samples)') | ||
plt.ylabel('Voltage (a.u.)') | ||
|
||
|
||
@savefig | ||
@style_plot | ||
def plot_lagged_coherence(freqs, lcs, ax=None): | ||
"""Plot lagged coherence values across frequencies. | ||
Parameters | ||
---------- | ||
freqs : 1d array | ||
Vector of frequencies at which lagged coherence was computed. | ||
lcs : 1d array | ||
Lagged coherence values across the computed frequencies. | ||
ax : matplotlib.Axes, optional | ||
Figure axes upon which to plot. | ||
""" | ||
|
||
ax = check_ax(ax, (6, 3)) | ||
|
||
plt.plot(freqs, lcs, 'k.-') | ||
|
||
plt.xlabel('Frequency (Hz)') | ||
plt.ylabel('Lagged Coherence') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.