xy logo

xy

Ultra-fast and customizable Python charts

endpointdocs reflex.devpython 3.11+
Website GitHub

What is it?

What it is

A fast, interactive Python charting library for web, notebooks, and static exports, capable of rendering up to 100 million points efficiently.

Why it exists

To provide a flexible, high-performance charting solution for Python users handling everything from everyday plots to large datasets and custom visualizations.

Who should use it

Python developersData scientistsData analystsWeb application developers using ReflexResearchers working with large-scale datasets

Who should avoid it

Users requiring a stable production-ready library (currently in alpha)Users who do not use Python

How it works

A quick walkthrough in plain English

How xy works

Step 1 of 3

You interact with it

Open xy, send a request, or connect it to your stack.

Features

Declarative and matplotlib-compatible API
Customizable with Python, CSS, or Tailwind
Interactive pan, zoom, hover, selection with drill‑down to original data
Automatic level‑of‑detail: exact points for small views, density surface for large data
Export to HTML, PNG, SVG, PDF
Works in Jupyter notebooks, web apps, and static sites
Reflex integration for pure‑Python web components
Handles massive datasets (demonstrated with 10 billion points)
Supports marks customization: color, size, opacity, symbols, gradients, strokes, colormaps
Guide customization: axes, ticks, grids, legends, toolbars, colorbars

Advantages

  • Near‑constant render time across 10 k–100 M points (≈0.07‑0.08 s)
  • Low Python‑side memory footprint (scales to ~2.6 GiB for 100 M points)
  • Fast interactive response due to Rust‑core computation and binary payloads
  • Exact data returned on hover/selection even after aggregation
  • Simple installation via pip/uv
  • Matplotlib‑like drop‑in replacement for existing code
  • Active development with frequent enhancements
  • Open‑source Apache‑2.0 license

Disadvantages

  • Currently in alpha; API may change
  • Not all matplotlib features are implemented yet
  • Limited chart types compared to mature libraries (roadmap ongoing)
  • Requires Rust toolchain for building from source (if needed)
  • Documentation and examples still growing

Installation

native

pip install xy

# or, with uv
uv add xy

FAQ

How does XY handle extremely large datasets without crashing the browser?

For large datasets, XY uses a Rust core to compute a screen-bounded density surface or decimated view, transferring only the necessary data to the browser. As you zoom in, the library requests refined payloads to resolve individual points.

Can I use XY within an existing Matplotlib workflow?

Yes, XY provides a compatibility layer via `xy.pyplot`. You can often keep your existing plotting code by simply changing the import to `import xy.pyplot as plt`.

How do I integrate XY charts into a Reflex web application?

You can use the `reflex-xy` adapter. After installing it, register the `reflex_xy.XYPlugin()` in your `rxconfig.py` and use the `reflex_xy.chart()` component to embed your charts.

What formats can I export my charts to?

XY supports exporting charts to HTML, PNG, SVG, and PDF formats.

Is XY suitable for production-grade web applications?

XY is currently in alpha and is receiving frequent enhancements. It is designed for high performance in notebooks, web apps, and static exports, supporting interactive features like pan, zoom, and hover.

Loading documentation…
View on GitHub

Featured in Videos

YouTube tutorials and walkthroughs for xy

Alternatives

Similar projects ranked by category, topics, and text overlap.

Compare
xy | MushyBook