Skip to main content

Interactive Plotly Express plotting accessor for xarray

Project description

xarray_plotly

Interactive Plotly Express plotting for xarray

PyPI version Python CI Docs License: MIT

Installation

pip install xarray_plotly

Quick Start

import xarray as xr
import numpy as np
import xarray_plotly  # registers the accessor

da = xr.DataArray(
    np.random.randn(100, 3).cumsum(axis=0),
    dims=["time", "city"],
    coords={"time": np.arange(100), "city": ["NYC", "LA", "Chicago"]},
)

# Accessor style
fig = da.plotly.line()
fig.show()

# Or with xpx() for IDE code completion
from xarray_plotly import xpx
fig = xpx(da).line()

Why xpx()? The accessor (da.plotly) works but IDEs can't provide code completion for it. This is because xarray accessors are registered dynamically at runtime, making them invisible to static type checkers. The xpx() function provides the same functionality with full IDE support. This limitation could only be solved by xarray itself, if at all — it may be a fundamental Python limitation.

Documentation

Full documentation: https://fbumann.github.io/xarray_plotly

Roadmap

Planned additions (contributions welcome):

New plot types

  • histogram() — distribution of DataArray values
  • violin() — richer distribution visualization than box plots
  • density_heatmap() — 2D histograms (x and y as dimensions)
  • density_contour() — 2D density contours (x and y as dimensions)

Enhancements

  • WebGL rendering option for line() and scatter() (large datasets)

Figure utilities (facet/animation-aware)

  • fill_between() — fill area between two traces (uncertainty bands)
  • sync_axes() — consistent axis ranges across facets and animation frames
  • add_secondary_x() — secondary x-axis (like add_secondary_y())
  • stack() — vertically stack separate figures into subplots

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xarray_plotly-0.0.17.tar.gz (62.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xarray_plotly-0.0.17-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file xarray_plotly-0.0.17.tar.gz.

File metadata

  • Download URL: xarray_plotly-0.0.17.tar.gz
  • Upload date:
  • Size: 62.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xarray_plotly-0.0.17.tar.gz
Algorithm Hash digest
SHA256 56566bdc28d57be0550108bc174e1b569b261ef52ab420038687ed63b9489df5
MD5 b9ceeadabe981995fce0184964622ec8
BLAKE2b-256 f7d3f1a697db9c1913329c00eaf15b6c325def7b3f1232e4301778826a71993d

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_plotly-0.0.17.tar.gz:

Publisher: publish.yaml on FBumann/xarray_plotly

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xarray_plotly-0.0.17-py3-none-any.whl.

File metadata

  • Download URL: xarray_plotly-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xarray_plotly-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 edb3d386aeecb7f3ffe645123625e05057f86a9159b6bfc1b6a55244ff38c0aa
MD5 806aec719f68f5d0ebabe96c67dc804f
BLAKE2b-256 098e5d20130b14c637f9c95b12a2af3b94dda781125e2e6a97de49a400c6cfb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_plotly-0.0.17-py3-none-any.whl:

Publisher: publish.yaml on FBumann/xarray_plotly

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page