How to use brokenaxes - 3 common examples

To help you get started, we’ve selected a few brokenaxes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bendichter / brokenaxes / brokenaxes.py View on Github external
def brokenaxes(*args, **kwargs):
    """Convenience method for `BrokenAxes` class.
    
    Parameters
    ----------
    args, kwargs: passed to `BrokenAxes()`
    
    Returns
    -------
    out: `BrokenAxes`
    """
    return BrokenAxes(*args, **kwargs)
github bendichter / brokenaxes / brokenaxes.py View on Github external
def __getattr__(self, method):
        """Catch all methods that are not defined and pass to internal axes
         (e.g. plot, errorbar, etc.).
        """
        return CallCurator(method, self)
github bendichter / brokenaxes / docs / source / auto_examples / plot_logscales.py View on Github external
Log scales
==========

Brokenaxes computes automatically the correct layout for a 1:1 scale. For
logarithmic scales, the 1:1 scale has to be adapted using the `yscale` or 
`xscale` arguments.

"""


import matplotlib.pyplot as plt
from brokenaxes import brokenaxes
import numpy as np

fig = plt.figure(figsize=(5,5))
bax = brokenaxes(xlims=((1, 500), (600, 10000)),
	     ylims=((1, 500), (600, 10000)),
		 hspace=.15, xscale='log', yscale='log')

x = np.logspace(0.0, 4, 100)
bax.loglog(x, x, label='$y=x=10^{0}$ to $10^{4}$')

bax.legend(loc='best')
bax.grid(axis='both', which='major', ls='-')
bax.grid(axis='both', which='minor', ls='--', alpha=0.4)
bax.set_xlabel('x')
bax.set_ylabel('y')
plt.show()

brokenaxes

Create broken axes

MIT
Latest version published 2 months ago

Package Health Score

76 / 100
Full package analysis

Similar packages