-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[MRG] plot_ica_properties #3275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ae90d83
c00db72
5886a41
347768a
25069ec
eb256cc
66ecc4a
6cd0d00
726fb1e
fda3a77
367e286
2ac3628
0a3d4d7
e3bdc01
c68f464
953f600
649df75
f83fe45
9cc0dd4
abfe7ec
34df9ee
703e2c5
d73a7f0
95d951d
2a0c1f6
b9eba08
def2de5
51ad0f8
0ce0ae2
034ab95
7adc9fa
2de5797
a43ad90
388b72a
e38cb0f
326dd13
d5ea637
d76f53a
b661a01
1674e05
de59279
4dd10a3
d736d40
9942e34
e057900
b91214c
0644a32
95e397c
e60b41a
0b18bb2
71dbf13
b5bb30d
fd10115
836d0f5
b4af3dd
6846398
016302a
67dc7c2
ecf063f
bd53c60
1a79787
e859433
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
from ..epochs import _BaseEpochs | ||
from ..viz import (plot_ica_components, plot_ica_scores, | ||
plot_ica_sources, plot_ica_overlay) | ||
from ..viz.ica import plot_ica_properties | ||
from ..viz.utils import (_prepare_trellis, tight_layout, plt_show, | ||
_setup_vmin_vmax) | ||
from ..viz.topomap import (_prepare_topo_plot, _check_outlines, | ||
|
@@ -1400,6 +1401,58 @@ def plot_components(self, picks=None, ch_type=None, res=64, layout=None, | |
image_interp=image_interp, | ||
head_pos=head_pos) | ||
|
||
def plot_properties(self, inst, picks=None, axes=None, dB=True, | ||
plot_std=True, topomap_args=None, image_args=None, | ||
psd_args=None, figsize=None, show=True): | ||
"""Display component properties: topography, epochs image, ERP, | ||
power spectrum and epoch variance. | ||
|
||
Parameters | ||
---------- | ||
inst: instance of Epochs or Raw | ||
The data to use in plotting properties. | ||
picks : int | array-like of int | None | ||
The components to be displayed. If None, plot will show the first | ||
five sources. If more than one components were chosen in the picks, | ||
each one will be plotted in a separate figure. Defaults to None. | ||
axes: list of matplotlib axes | None | ||
List of five matplotlib axes to use in plotting: [topo_axis, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. topomap_axis? |
||
image_axis, erp_axis, spectrum_axis, variance_axis]. If None a new | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @agramfort I have called it ts_axis (for time series axis) in plot_joint, but maybe ERP would be better? |
||
figure with relevant axes is created. Defaults to None. | ||
dB: bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would set dB =True by default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, that would be better. |
||
Whether to plot spectrum in dB. Defaults to True. | ||
plot_std: bool | float | ||
Whether to plot standard deviation in ERP/ERF and spectrum plots. | ||
Defaults to True, which plots one standard deviation above/below. | ||
If set to float allows to control how many standard deviations are | ||
plotted. For example 2.5 will plot 2.5 standard deviation | ||
above/below. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess True would be cast to int ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To 1., I mean. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do it explicitly in the code - if bool then set relevant variable to 1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure. I guess it's okay. |
||
topomap_args : dict | None | ||
Dictionary of arguments to ``plot_topomap``. If None, doesn't pass | ||
any additional arguments. Defaults to None. | ||
image_args : dict | None | ||
Dictionary of arguments to ``plot_epochs_image``. If None, doesn't | ||
pass any additional arguments. Defaults to None. | ||
psd_args : dict | None | ||
Dictionary of arguments to ``psd_multitaper``. If None, doesn't | ||
pass any additional arguments. Defaults to None. | ||
figsize : array-like of size (2,) | None | ||
Allows to control size of the figure. If None the figure size | ||
defauls to [7., 6.]. | ||
show : bool | ||
Show figure if True. | ||
|
||
Returns | ||
------- | ||
fig : list | ||
List of matplotlib figures. | ||
""" | ||
return plot_ica_properties(inst, self, picks=picks, axes=axes, | ||
dB=dB, plot_std=plot_std, | ||
topomap_args=topomap_args, | ||
image_args=image_args, psd_args=psd_args, | ||
figsize=figsize, show=show) | ||
|
||
def plot_sources(self, inst, picks=None, exclude=None, start=None, | ||
stop=None, title=None, show=True, block=False): | ||
"""Plot estimated latent sources given the unmixing matrix. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also doc that **kwargs will be passed to Epochs