Skip to content

Instantly share code, notes, and snippets.

View baldwint's full-sized avatar

Tom Baldwin baldwint

View GitHub Profile
@baldwint
baldwint / scalebars.py
Last active August 29, 2015 14:01 — forked from dmeliza/scalebars.py
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# Adapted from mpl_toolkits.axes_grid2
# LICENSE: Python Software Foundation (http://docs.python.org/license.html)
from matplotlib.offsetbox import AnchoredOffsetbox
class AnchoredScaleBar(AnchoredOffsetbox):
def __init__(self, transform, sizex=0, sizey=0, labelx=None, labely=None, loc=4,
pad=0.1, borderpad=0.1, sep=2, prop=None, **kwargs):
"""