How to use the brainspace.plotting.utils._grep_args function in brainspace

To help you get started, we’ve selected a few brainspace examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MICA-MNI / BrainSpace / brainspace / plotting / surface_plotting.py View on Github external
if share == 'r' and color_bar in {'top', 'bottom'}:
        raise ValueError("Incompatible color_bar=%s and "
                         "share=%s" % (color_bar, share))

    layout = np.atleast_2d(layout)
    nrow, ncol = shape = layout.shape

    view = _broadcast(view, 'view', shape)
    zoom = _broadcast(zoom, 'zoom', shape)

    array_name = _expand_arg(array_name, 'array_name', shape)
    cmap = _expand_arg(cmap, 'cmap', shape, ref=array_name)
    color_range = _expand_arg(color_range, 'cbar_range', shape, ref=array_name)

    ren_kwds = _grep_args('renderer', shape, kwargs)
    actor_kwds = _grep_args('actor', shape, kwargs, ref=array_name)
    mapper_kwds = _grep_args('mapper', shape, kwargs, ref=array_name)

    # Label text
    if label_text is None:
        label_text = {}
    elif isinstance(label_text, (list, np.ndarray)):
        label_text = {'left': label_text}

    # Array ranges
    specs = _get_ranges(layout, surfs, array_name, share, color_range)

    # Grid
    grid_row, grid_col, ridx, cidx, entries = \
        _gen_grid(nrow, ncol, label_text, color_bar, share)

    kwargs.update({'nrow': grid_row, 'ncol': grid_col, 'size': size})
github MICA-MNI / BrainSpace / brainspace / plotting / surface_plotting.py View on Github external
if share == 'r' and color_bar in {'top', 'bottom'}:
        raise ValueError("Incompatible color_bar=%s and "
                         "share=%s" % (color_bar, share))

    layout = np.atleast_2d(layout)
    nrow, ncol = shape = layout.shape

    view = _broadcast(view, 'view', shape)
    zoom = _broadcast(zoom, 'zoom', shape)

    array_name = _expand_arg(array_name, 'array_name', shape)
    cmap = _expand_arg(cmap, 'cmap', shape, ref=array_name)
    color_range = _expand_arg(color_range, 'cbar_range', shape, ref=array_name)

    ren_kwds = _grep_args('renderer', shape, kwargs)
    actor_kwds = _grep_args('actor', shape, kwargs, ref=array_name)
    mapper_kwds = _grep_args('mapper', shape, kwargs, ref=array_name)

    # Label text
    if label_text is None:
        label_text = {}
    elif isinstance(label_text, (list, np.ndarray)):
        label_text = {'left': label_text}

    # Array ranges
    specs = _get_ranges(layout, surfs, array_name, share, color_range)

    # Grid
    grid_row, grid_col, ridx, cidx, entries = \
        _gen_grid(nrow, ncol, label_text, color_bar, share)
github MICA-MNI / BrainSpace / brainspace / plotting / surface_plotting.py View on Github external
raise ValueError("Incompatible color_bar=%s and "
                         "share=%s" % (color_bar, share))

    layout = np.atleast_2d(layout)
    nrow, ncol = shape = layout.shape

    view = _broadcast(view, 'view', shape)
    zoom = _broadcast(zoom, 'zoom', shape)

    array_name = _expand_arg(array_name, 'array_name', shape)
    cmap = _expand_arg(cmap, 'cmap', shape, ref=array_name)
    color_range = _expand_arg(color_range, 'cbar_range', shape, ref=array_name)

    ren_kwds = _grep_args('renderer', shape, kwargs)
    actor_kwds = _grep_args('actor', shape, kwargs, ref=array_name)
    mapper_kwds = _grep_args('mapper', shape, kwargs, ref=array_name)

    # Label text
    if label_text is None:
        label_text = {}
    elif isinstance(label_text, (list, np.ndarray)):
        label_text = {'left': label_text}

    # Array ranges
    specs = _get_ranges(layout, surfs, array_name, share, color_range)

    # Grid
    grid_row, grid_col, ridx, cidx, entries = \
        _gen_grid(nrow, ncol, label_text, color_bar, share)

    kwargs.update({'nrow': grid_row, 'ncol': grid_col, 'size': size})
    p = Plotter(**kwargs)