This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def autoscale(ax=None, axis='y', margin=0.1): | |
'''Autoscales the x or y axis of a given matplotlib ax object | |
to fit the margins set by manually limits of the other axis, | |
with margins in fraction of the width of the plot | |
Defaults to current axes object if not specified. | |
''' | |
import matplotlib.pyplot as plt | |
import numpy as np | |
if ax is None: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.