{"id":23381,"library":"brokenaxes","title":"brokenaxes","description":"Creates broken axes in matplotlib to plot data with discontinuities or different scales. Current version 0.6.2, release cadence sporadic.","status":"active","version":"0.6.2","language":"python","source_language":"en","source_url":"https://github.com/bendichter/brokenaxes","tags":["matplotlib","broken-axis","visualization"],"install":[{"cmd":"pip install brokenaxes","lang":"bash","label":"pip install brokenaxes"}],"dependencies":[],"imports":[{"note":"brokenaxes is a function/class, not a module; direct import may cause AttributeError","wrong":"import brokenaxes","symbol":"brokenaxes","correct":"from brokenaxes import brokenaxes"}],"quickstart":{"code":"import matplotlib.pyplot as plt\nfrom brokenaxes import brokenaxes\nimport numpy as np\n\nfig = plt.figure(figsize=(6, 3))\nbax = brokenaxes(xlims=((0, 0.1), (0.4, 0.6)), ylims=((0, 10), (20, 25)), hspace=0.05, wspace=0.05)\nx = np.linspace(0, 0.6, 100)\ny = 10 * np.sin(50 * x) + 20 * np.sin(5 * x) + 5\nbax.plot(x, y)\nplt.show()","lang":"python","description":"Creates a broken axes object with two x and y ranges, then plots data across the break."},"warnings":[{"fix":"Reset matplotlib style after use: matplotlib.style.use('default')","message":"brokenaxes modifies global matplotlib style; may affect other plots in same session.","severity":"gotcha","affected_versions":"all"},{"fix":"Call bax.standardize() after plotting to reposition ticks.","message":"Auto-tick positioning can place ticks at discontinuities; subplots_advance() call needed to update ticks after plot.","severity":"gotcha","affected_versions":"all"},{"fix":"Use diag_color='k' and diag_kwargs={'lw':2} instead of d and tilt.","message":"Parameters like 'd' and 'tilt' are deprecated; use 'diag_color' and 'diag_kwargs' instead.","severity":"deprecated","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from brokenaxes import brokenaxes","cause":"Importing the module instead of the function/class.","error":"AttributeError: module 'brokenaxes' has no attribute 'brokenaxes'"},{"fix":"Use: xlims=((0,1),(3,4)) — a list/tuple of two or more (min,max) tuples.","cause":"Passing incorrectly formatted limits, e.g., a single tuple.","error":"ValueError: xlims must be a list of tuples or a tuple of tuples"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}