An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improved styling of Topoplot

jdpigeon 3c43140d 021b8526

+14 -2
+14 -2
app/utils/jupyter/utils.py
··· 9 9 import seaborn as sns 10 10 from matplotlib import pyplot as plt 11 11 12 - 13 12 sns.set_context('talk') 14 13 sns.set_style('white') 15 14 ··· 76 75 def plot_topo(epochs, conditions=OrderedDict()): 77 76 palette = sns.color_palette("hls", len(conditions) + 1) 78 77 evokeds = [epochs[name].average() for name in (conditions)] 78 + 79 79 evoked_topo = viz.plot_evoked_topo( 80 - evokeds, color=palette[0:len(conditions)]) 80 + evokeds, vline=None, color=palette[0:len(conditions)], show=False) 81 + #evoked_topo.facecolor = 'lightslategray' 82 + evoked_topo.patch.set_alpha(0) 83 + evoked_topo.set_size_inches(10,8) 81 84 for axis in evoked_topo.axes: 82 85 for line in axis.lines: 83 86 line.set_linewidth(2) 87 + 88 + legend_loc = 0 89 + labels = [e.comment if e.comment else 'Unknown' for e in evokeds] 90 + legend = plt.legend(labels, loc=legend_loc, prop={'size': 20}) 91 + legend.get_frame().set_facecolor(axis_facecolor) 92 + txts = legend.get_texts() 93 + for txt, col in zip(txts, palette): 94 + txt.set_color(col) 95 + 84 96 return evoked_topo 85 97 86 98