Metadata-Version: 2.1
Name: uplot-python
Version: 1.0.0
Summary: Python wrapper for μPlot time series.
Keywords: json,time,series,plot
Author-email: Stéphane Caron <stephane.caron@normalesup.org>
Maintainer-email: Stéphane Caron <stephane.caron@normalesup.org>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Dist: ipython >=8.0.1
Requires-Dist: msgpack >=1.0.4
Requires-Dist: numpy >=1.15.4
Project-URL: Changelog, https://github.com/stephane-caron/uplot-python/blob/master/CHANGELOG.md
Project-URL: Homepage, https://github.com/stephane-caron/uplot-python
Project-URL: Source, https://github.com/stephane-caron/uplot-python
Project-URL: Tracker, https://github.com/stephane-caron/uplot-python/issues

# uplot-python

Python wrapper for [μPlot](https://github.com/leeoniya/uPlot) 📈

## Installation

### From PyPI

```console
pip install uplot-python
```

## Usage

The `plot` function has the same API as µPlot's `uPlot.plot`:

```py
import numpy as np
import uplot

t = np.linspace(0.0, 1.0, 10)
data = [t, np.exp(0.42 * t)]
opts = {
    "width": 1920,
    "height": 600,
    "title": "Example with plot",
    "series": [{}, { "stroke": "red", }, ],
}

uplot.plot(opts, data)
```

For convenience, the library also provides a `plot2` function with additional defaults aimed at time series and line plots, for an experience closer to `matplotlib.pyplot.plot`:

```py
import numpy as np
import uplot

t = np.linspace(0.0, 1.0, 10)
uplot.plot2(
    t,
    [np.exp(0.1 * t), np.exp(-10.0 * t), np.cos(t)],
    title="Example with plot2",
    left_labels=["exp(A t)", "exp(-B t)", "cos(t)"],
)
```

## See also

- [µPlot](https://github.com/leeoniya/uPlot): A small (~45 KB min), fast chart for time series, lines, areas, ohlc & bars.
- [Matplotlib](https://matplotlib.org/stable/): Comprehensive library for creating static, animated, and interactive visualizations.
- [matplotlive](https://github.com/stephane-caron/matplotlive): Stream live plots to a Matplotlib figure.

