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.14.tar.gz (49.2 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.14-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xarray_plotly-0.0.14.tar.gz
Algorithm Hash digest
SHA256 4e4b9b8172d06cc5b34ae4edc67f40289d418f96e7dc5a01fccdbfd9ccffc116
MD5 1ce1d2f8fb83baaffef256fdf5ed8462
BLAKE2b-256 8e73e7c76767c815b409e5e9a7b9977a859e257b5f887be25c75ce8a206d1a11

See more details on using hashes here.

Provenance

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

Publisher: release.yml 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.14-py3-none-any.whl.

File metadata

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

File hashes

Hashes for xarray_plotly-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 773f3eb0acf0c4ce240f5e463e42b8287b8d4d6984a17fd796a39cc592832cfc
MD5 067e5e46adc09e34a06a83644e6626b7
BLAKE2b-256 54d3eaed3f605ec731acdaaf86572b73bc1bbb9065e0e8a3c26c886f9d3e9f8c

See more details on using hashes here.

Provenance

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

Publisher: release.yml 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