Skip to content

Instantly share code, notes, and snippets.

View matejak's full-sized avatar

Matěj Týč matejak

View GitHub Profile
@matejak
matejak / scalebars.py
Created November 17, 2012 22:38 — forked from dmeliza/scalebars.py
matplotlib: add scale bars to axes - enhanced
# -*- 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, size=0, label=None, horizontal = True, style = 'dark', loc=4,
pad=0.1, borderpad=0.1, sep=2, prop=None, **kwargs):
"""