Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Baldwin baldwint

View GitHub Profile
View truncated-poisson-convergence.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pd-bug-mwe-master.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View dumb_multiindex_tricks.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View slack-export.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View include_annotations.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View h2c-2015.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mintplot.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View marathon_2015.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View margins.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@baldwint
baldwint / sizebars.py
Created Nov 22, 2014
Convenience function for adding a horizontal scalebar (aka sizebar) to axes. For a vertical sizebar, see https://gist.github.com/dmeliza/3251476
View sizebars.py
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
def add_sizebar(ax, size, **kwargs):
kwargs.setdefault('label', str(size))
kwargs.setdefault('loc', 4)
asb = AnchoredSizeBar(ax.transData, size, **kwargs)
ax.add_artist(asb)
return asb