Skip to main content
outset wordmark

PyPi docs GitHub stars CI Deploy Sphinx documentation to Pages zenodo

add zoom indicators, insets, and magnified panels to matplotlib/seaborn visualizations with ease!

Features

  • compose axes grids to juxtapose a complete plot with data subsets or magnified subregions

  • render grid axes as overlaid insets

  • draw elegant zoom indicators with publication-ready default styling

  • enjoy a familiar, data-oriented interface — with full feature sets inherited directly from seaborn

  • abstract away handling of padding and aspect ratios

  • fine-tune appearance and layout with extensive styling options and bundled numbering/symbol library

  • use hooks to inject custom functionality, like numbering/symbols and layout tweaks

Install

python3 -m pip install outset

Basic Usage

Use outset.OutsetGrid to compose source plot with zoom panels on an axes grid. Zoom sections can be a) designated manually or b) inferred to bound data subsets. To overlay zoom panels onto source plot, c) call outset.inset_outsets.

a) Create OutsetGrid, Explicit Zoom Areas

from matplotlib import pyplot as plt
import numpy as np
import outset as otst
import seaborn as sns
# adapted from # https://matplotlib.org/stable/gallery/
i, a, b, c, d = np.arange(0.0, 2*np.pi, 0.01), 1, 7, 3, 11

# 3 axes grid: source plot and two zoom frames
grid = otst.OutsetGrid([(-10, 8, -8, 12), (-5, 5, -1, 3)])  # frame coords
grid.broadcast(plt.plot,  # run plotter over all axes
   np.sin(i*a)*np.cos(i*b) * 20, np.sin(i*c)*np.cos(i*d) * 20,  # line coords
   c="k", zorder=-1)  # kwargs forwarded to plt.plot

grid.marqueeplot()  # set axlims and render marquee annotations
usage example 1 result

b) Create OutsetGrid, Inferred Zoom Areas

grid = otst.OutsetGrid(data=sns.load_dataset("iris").dropna(),  # facet over axes grid
   x="petal_width", y="petal_length",
   col="species",  # create zoom panel for each species
   hue="species",  # color marquee annotations by species
   aspect=0.6, height=3)  # adjust axes grid geometry
grid.map_dataframe(sns.scatterplot,  # map plotter over faceted data
   x="petal_width", y="petal_length", legend=False, zorder=0)

grid.marqueeplot()   # set axlims and render marquee annotations
grid.add_legend()  # add figure-level legend
usage example 2 result

c) Overlay Zoom Panels as Insets

grid = otst.OutsetGrid(data=sns.load_dataset("iris").dropna(),  # facet over axes grid
   x="petal_width", y="petal_length",
   col="species",  # put each species in its own outset
   hue="species",   # make different color marquees
   aspect=1.5, height=4)  # adjust axes grid geometry
grid.map_dataframe(sns.scatterplot,  # map plotter over faceted data
   x="petal_width", y="petal_length", legend=False, zorder=0)

grid.add_legend()  # add figure-level legend
otst.inset_outsets(grid, insets="NW")  # inset outsets in upper-left corner
grid.marqueeplot()  # set axlims and render marquee annotations
usage example 3 result

See the quickstart guide for more detailed usage information.

API Overview

  • outset.OutsetGrid: compose a source plot and zoom regions over it (e.g., “outsets”) on a multiplot lattice

    • designate zoom regions directly, or as regions containing data subsets

    • object-oriented, “tidy data” interface a la seaborn.FacetGrid

  • outset.inset_outsets: rearrange an OutsetGrid to place outset zoom regions as insets over the original source axes

  • outset.marqueeplot: axis-level “tidy data” interface to draw marquees framing specified subsets of data

  • outset.draw_marquee: low-level interface to draw individual marquee annotations

Read the full API documentation here.

Available Styling Extensions

Callout mark glyphs: customize marquee identifiers; pass as mark_glyph kwarg

outset.mark.MarkAlphabeticalBadges | outset.mark.MarkArrow | outset.mark.MarkInlaidAsterisk | outset.mark.MarkMagnifyingGlass | outset.mark.MarkRomanBadges

comparison of available glyphs

These mark glyphs can also be used directly, independently of the rest of the library!

Callout tweaks: customize how marquee callouts are shaped and positioned; pass as leader_tweak kwarg

Citation

If outset is used in scientific publication, please cite it as

Matthew Andres Moreno. (2023). mmore500/outset. Zenodo. https://doi.org/10.5281/zenodo.10426106

@software{moreno2023outset,
  author = {Matthew Andres Moreno},
  title = {mmore500/outset},
  month = dec,
  year = 2023,
  publisher = {Zenodo},
  doi = {10.5281/zenodo.10426106},
  url = {https://doi.org/10.5281/zenodo.10426106}
}

Consider also citing matplotlib and seaborn . And don’t forget to leave a star on GitHub!

Contributing

This project welcomes contributions and suggestions. Documentation includes detailed information to get you started.

Metadata

Release files for outset 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for outset 0.1.9
File Size Uploaded
outset-0.1.9.tar.gz 5.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for outset 0.1.9
File Interpreter ABI Platform
outset-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 MB

Release files / outset-0.1.9.tar.gz

Download URL outset-0.1.9.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
57408a9dd6b51f688b1c0164a73781b72fe94e88d0f2e9e61837bd9410a27cb0
BLAKE2b-256 checksum
How to use checksums
9cb2858db395bbcf735daa84a423b4ac7c5e01d759cdbe5b70557a9b364d45a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / outset-0.1.9-py3-none-any.whl

Download URL outset-0.1.9-py3-none-any.whl
Size 57.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90b228753259d4db18d143237f82d6271219d9479dce13edc27bb9e30742c53a
BLAKE2b-256 checksum
How to use checksums
e59c980426b5649204b2463e8eb6671b60cf387817cf69dfd14d1cdab60f31a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page