mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.7k stars 1.31k forks source link

AttributeError: 'NoneType' object has no attribute '_Renderer' #8272

Closed anupdas777 closed 4 years ago

anupdas777 commented 4 years ago

I am using the following code to plot ECoG electrodes on a brain surface using MNE toolbox.

montage = mne.channels.make_dig_montage(elec_dict, coord_frame='head') info = mne.create_info(ch_names, 1000., 'ecog').set_montage(montage) subjects_dir = '/home1/anup.das/mne_data/MNE-sample-data/subjects/' fig = plot_alignment(info, subject='fsaverage', subjects_dir=subjects_dir, surfaces=['pial'])

However I get the error "'NoneType' object has no attribute '_Renderer'" while executing the last line "fig = plot_alignment(info, subject='fsaverage', subjects_dir=subjects_dir, surfaces=['pial'])".

ch_names is as follows:

['LFPG1', 'LFPG2', 'LFPG3', 'LFPG4', 'LFPG5', 'LFPG6', 'LFPG7', 'LFPG8', 'LFPG9', 'LFPG10', 'LFPG11', 'LFPG12', 'LFPG13', 'LFPG14', 'LFPG15', 'LFPG16', 'LFPG17', 'LFPG18', 'LFPG19', 'LFPG20', 'LFPG21', 'LFPG22', 'LFPG23', 'LFPG24', 'LFPG25', 'LFPG26', 'LFPG27', 'LFPG28', 'LFPG29', 'LFPG30', 'LFPG31', 'LFPG32', 'LSPIS1', 'LSPIS2', 'LSPIS3', 'LSPIS4', 'LIPIS1', 'LIPIS2', 'LIPIS3', 'LIPIS4', 'LAIS1', 'LAIS2', 'LAIS3']

elec_dict is as follows:

{'LFPG1': [-0.0211204, 0.0518157, 0.0425739356174474], 'LFPG2': [-0.021700700000000003, 0.0444696, 0.0497241092479105], 'LFPG3': [-0.0231085, 0.0357866, 0.0537190762100455], 'LFPG4': [-0.0215652, 0.028994100000000002, 0.059433985242819405], 'LFPG5': [-0.017928200000000002, 0.0202426, 0.06282722560521581], 'LFPG6': [-0.0128325, 0.00806245, 0.06988643950838799], 'LFPG7': [-0.009182560000000001, -0.000170408, 0.07066406845412461], 'LFPG8': [-0.0148465, -0.00717425, 0.0744570765099918], 'LFPG9': [-0.0297575, 0.0494856, 0.0371787602006774], 'LFPG10': [-0.029237100000000002, 0.04269680000000001, 0.0453629682230858], 'LFPG11': [-0.0288688, 0.034545400000000004, 0.049347715501969], 'LFPG12': [-0.0325394, 0.0269882, 0.0547113948325137], 'LFPG13': [-0.0311134, 0.0179123, 0.060000938258775796], 'LFPG14': [-0.0297766, 0.00610056, 0.0660969066265409], 'LFPG15': [-0.030526800000000003, -0.00986761, 0.0683945391257418], 'LFPG16': [-0.0319256, -0.0153364, 0.0721121740764809], 'LFPG17': [-0.0374236, 0.0464388, 0.0312989921755522], 'LFPG18': [-0.038046300000000005, 0.038786900000000006, 0.04151989065957121], 'LFPG19': [-0.0382915, 0.033554299999999995, 0.0454499399952208], 'LFPG20': [-0.0421091, 0.0229929, 0.0505558727308064], 'LFPG21': [-0.0414722, 0.013149300000000001, 0.0567791186691879], 'LFPG22': [-0.04165870000000001, 0.00303469, 0.0600087223847562], 'LFPG23': [-0.0440802, -0.00777111, 0.061366063652951504], 'LFPG24': [-0.044979399999999996, -0.017612600000000003, 0.06481629719808021], 'LFPG25': [-0.0459443, 0.04392240000000001, 0.0259704470121004], 'LFPG26': [-0.0460278, 0.0357858, 0.034095457751498005], 'LFPG27': [-0.045699, 0.0280037, 0.0414376209107973], 'LFPG28': [-0.046341299999999995, 0.0171388, 0.0480353317908815], 'LFPG29': [-0.0485106, 0.00963697, 0.050873368845506695], 'LFPG30': [-0.0500475, 0.00046404400000000004, 0.054828320908896305], 'LFPG31': [-0.0525009, -0.00852335, 0.055103119660809906], 'LFPG32': [-0.053044100000000004, -0.019564, 0.0573054222573997], 'LSPIS1': [-9.31769e-05, -0.0744192, 0.0385639418886536], 'LSPIS2': [-4.51567e-05, -0.0628905, 0.0487602096610609], 'LSPIS3': [0.0013493, -0.0516644, 0.056598275392439], 'LSPIS4': [0.00162881, -0.04233870000000001, 0.062016586796788606], 'LIPIS1': [0.0049590500000000004, -0.06371840000000001, 0.0426646026901921], 'LIPIS2': [0.00171951, -0.051365400000000005, 0.0504772296053725], 'LIPIS3': [0.0018220600000000001, -0.046999400000000004, 0.0586447670523916], 'LIPIS4': [0.00178181, -0.0385381, 0.0594603833106994], 'LAIS1': [0.0018628499999999999, 0.00114678, 0.0244707713740858], 'LAIS2': [0.00117872, 0.00855424, 0.0320050649689319], 'LAIS3': [7.57824e-05, 0.0172445, 0.040820480774000106]}

Can anyone resolve this issue? Thanks.

drammock commented 4 years ago

Duplicate of #8271