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.16.tar.gz (59.9 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.16-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xarray_plotly-0.0.16.tar.gz
  • Upload date:
  • Size: 59.9 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.16.tar.gz
Algorithm Hash digest
SHA256 55bf746c8a7fb80eb29356c889cdd34054ba54cc32350f9fe3b976ad5237e86f
MD5 3e0a3937fdd47023cf3e6641c96f3fe3
BLAKE2b-256 58719272a099442449b0b7314b8dc48d0ef3eec47b5aeb5f32fec81e28b415fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_plotly-0.0.16.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.16-py3-none-any.whl.

File metadata

  • Download URL: xarray_plotly-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 27.9 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.16-py3-none-any.whl
Algorithm Hash digest
SHA256 8eaf467cb060d3b2814530e1cd92780fd09037a29facfcd67178f00b4c255d27
MD5 a2b04035f7c4908d163fc09ee2d6a5bf
BLAKE2b-256 bfcbbe0f7b5864518d6818651bc66eaf0afafa7bd844ad77048aa5a9c5684a9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_plotly-0.0.16-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