Skip to content

Instantly share code, notes, and snippets.

@jasmainak
Created August 24, 2016 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasmainak/f322967d9e18499431f4410183e1014c to your computer and use it in GitHub Desktop.
Save jasmainak/f322967d9e18499431f4410183e1014c to your computer and use it in GitHub Desktop.
fig = plot_topo(evokeds, ...)
ax = fig.get_axes()[1] # pick one of the sensor axes
bbox = ax.get_window_extent().transformed(fig.transFigure.inverted())
width, height = bbox.width, bbox.height
# Add the scale
ax = plt.axes([0.08, 0.08, width, height])
ax.tick_params(axis='y', direction='out')
ax.tick_params(axis='x', direction='out')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.set_xticks([])
ax.set_yticks([])
ax.set_xlabel('1.0 s')
ax.set_ylabel('40 fT/cm')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment