Skip to content

color argument is not respected in brain.add_label #8815

@jasmainak

Description

@jasmainak

I tried the following:

import os

import mne
from mne import read_source_estimate
from mne.datasets import sample

# Paths to example data
sample_dir_raw = sample.data_path()
sample_dir = os.path.join(sample_dir_raw, 'MEG', 'sample')
subjects_dir = os.path.join(sample_dir_raw, 'subjects')

fname_stc = os.path.join(sample_dir, 'sample_audvis-meg')

stc = read_source_estimate(fname_stc, subject='sample')

# Define plotting parameters
surfer_kwargs = dict(
    hemi='lh', subjects_dir=subjects_dir,
    clim=dict(kind='value', lims=[8, 12, 15]), views='lateral',
    initial_time=0.09, time_unit='s', size=(800, 800),
    smoothing_steps=5)

# Plot surface
brain = stc.plot(**surfer_kwargs)

vertex_id = 72752
label = mne.grow_labels('sample', vertex_id, 20, 0, subjects_dir=subjects_dir)[0]
brain.add_label(label, color='green')

it gives me an orange label instead of green.

Furthermore, if I do:

brain.remove_labels()

the label is not removed from the image. Not sharing screenshots because I have some rendering issue with these plots on my mac but you can verify/reproduce easily with the scripts above.

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