Skip to content
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

stc.plot with pyvista: error with hemi='both' #7250

Closed
SophieHerbst opened this issue Jan 24, 2020 · 4 comments · Fixed by #7253
Closed

stc.plot with pyvista: error with hemi='both' #7250

SophieHerbst opened this issue Jan 24, 2020 · 4 comments · Fixed by #7253

Comments

@SophieHerbst
Copy link
Contributor

I am not able to plot the two hemispheres of an stc at the same time with time_viewer=True , for instance when using this example:

stc.plot(hemi='both', subjects_dir=subjects_dir, initial_time=0.07,
          size=(800, 600),time_viewer=True)

Error:

File "/home/sh254795/pyvista/pyvista/plotting/plotting.py", line 2215, in subplot
raise IndexError('Column index is out of range ({})'.format(self.shape[1]))

IndexError: Column index is out of range (1)

With hemi='split' the panels overlap, and the time-slider is not usable (I can send a screenshot).
Also, from the documentation it is not clear to me what the difference between 'both' and 'split' would do.

@GuillaumeFavelier
Copy link
Contributor

Could you share a screenshot? It would help me understand the situation.

A fix for the slider position in hemi=split is in 5d78f05. The PR is still waiting for reviews but hopefully soon to be merged.

Also I can reproduce the issue with hemi=both so I'll work on a fix soon 👍

Also, from the documentation it is not clear to me what the difference between 'both' and 'split' would do.

From the doc of _Brain:

    hemi : str
        Hemisphere id (ie 'lh', 'rh', 'both', or 'split'). In the case
        of 'both', both hemispheres are shown in the same window.
        In the case of 'split' hemispheres are displayed side-by-side
        in different viewing panes.

The hemispheres are in the same view with both and are in different views with split. Feel free to share suggestions about how we can improve the documentation.

@GuillaumeFavelier
Copy link
Contributor

Here is an example:

Split Both
2020-01-24_1920x1080 2020-01-24_1920x1080

@SophieHerbst
Copy link
Contributor Author

Here is a screenshot, using the split option with time_viewer.
stc_plot_split

@SophieHerbst
Copy link
Contributor Author

About the doc: the one from _Brain is totally fine, it just needs to be copied to the one of stc.plot, which currently says:

hemi : str, ‘lh’ | ‘rh’ | ‘split’ | ‘both’

The hemisphere to display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants