Skip to content

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

Closed

Description

@SophieHerbst

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.

Activity

  1. GuillaumeFavelier commented on Jan 24, 2020

    @GuillaumeFavelier
    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.

  2. GuillaumeFavelier commented on Jan 24, 2020

    @GuillaumeFavelier
    Contributor

    Here is an example:

    Split Both
    2020-01-24_1920x1080 2020-01-24_1920x1080
  3. SophieHerbst commented on Jan 24, 2020

    @SophieHerbst
    ContributorAuthor

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

  4. SophieHerbst commented on Jan 24, 2020

    @SophieHerbst
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions