|
1 | | -anyplotlib |
2 | | -========== |
| 1 | +======================== |
| 2 | +anyplotlib Documentation |
| 3 | +======================== |
3 | 4 |
|
4 | | -.. toctree:: |
5 | | - :maxdepth: 2 |
6 | | - :caption: Contents |
7 | | - |
8 | | - getting_started |
9 | | - api/index |
10 | | - auto_examples/index |
11 | | - |
12 | | -Welcome to **anyplotlib** – a lightweight, interactive viewer for 1-D signals and |
13 | | -2-D images, backed by `anywidget <https://anywidget.dev/>`_ and a pure-JavaScript |
14 | | -canvas renderer. The goal is to duplicate and extend the interactive plotting capabilities of Matplotlib, |
15 | | -although the scope is intentionally limited in the following ways: |
| 5 | +anyplotlib is a lightweight, interactive plotting library for Jupyter notebooks and JupyterLab, |
| 6 | +backed by `anywidget <https://anywidget.dev/>`_ and a pure-JavaScript canvas renderer. It follows |
| 7 | +the object-oriented Matplotlib API — create a ``Figure``, call methods on ``Axes`` — while |
| 8 | +delivering real-time interactivity and high performance on large datasets through canvas-based |
| 9 | +blitting instead of SVG. |
16 | 10 |
|
17 | | -1. This uses the object-oriented API of Matplotlib, not the stateful pyplot interface. This means there is |
18 | | - no ``plt.imshow`` or ``plt.plot`` — instead, you create a figure object and call methods on axes to add |
19 | | - data and customize the plot. This is a deliberate choice to avoid the pitfalls of the stateful API. |
| 11 | +.. grid:: 2 3 3 3 |
| 12 | + :gutter: 2 |
20 | 13 |
|
21 | | - .. code-block:: python |
| 14 | + .. grid-item-card:: |
| 15 | + :link: getting_started |
| 16 | + :link-type: doc |
22 | 17 |
|
23 | | - import anyplotlib as apl |
24 | | - import matplotlib.pyplot as plt |
| 18 | + :octicon:`rocket;2em;sd-text-info` Getting Started |
| 19 | + ^^^ |
25 | 20 |
|
26 | | - # matplotlib: |
27 | | - fig, axs = plt.subplots(1, 1) |
28 | | - axs.imshow(...) |
| 21 | + New to anyplotlib? The getting started guide walks through installation and |
| 22 | + your first interactive figure in a Jupyter notebook. |
29 | 23 |
|
30 | | - # anyplotlib equivalent: |
31 | | - fig, axs = apl.subplots(1, 1) |
32 | | - axs.imshow(...) |
| 24 | + .. grid-item-card:: |
| 25 | + :link: api/index |
| 26 | + :link-type: doc |
33 | 27 |
|
34 | | -2. In matplotlib they use vector graphics (SVG) to render the plot, which is great for static images. It's especially |
35 | | - great for making publication-quality figures. (If you haven't tried inkscape + matplotlib SVG output, |
36 | | - it's pretty amazing.) For interactivity, it can be slow. Anyplotlib uses a pure-JavaScript canvas renderer which is |
37 | | - much faster for interactive applications, but the quality of the output is not as good as vector graphics. This is a |
38 | | - trade-off that we are willing to make for the sake of interactivity. |
| 28 | + :octicon:`code-square;2em;sd-text-info` API Reference |
| 29 | + ^^^ |
39 | 30 |
|
40 | | -3. Matplotlib supports a wide range of marker styles, line styles, and other plot elements. Anyplotlib focuses on a |
41 | | - core set of features that are most commonly used in scientific plotting. This means that some of the more |
42 | | - esoteric features of Matplotlib may not be available in Anyplotlib. In general we try to match the lower level |
43 | | - ``collections`` API of Matplotlib. |
| 31 | + Full documentation of the anyplotlib API — ``Figure``, ``Axes``, plot classes, |
| 32 | + markers, widgets, and callbacks — with parameter descriptions and type signatures. |
44 | 33 |
|
45 | | -4. Each collection, plot, image is rendered as a single object on the canvas. This is highly performant and more |
46 | | - importantly allows for blitting. This is one of the main reasons why the ``ipympl`` backend of Matplotlib is so slow. |
| 34 | + .. grid-item-card:: |
| 35 | + :link: auto_examples/index |
| 36 | + :link-type: doc |
47 | 37 |
|
48 | | -5. Finally ``anyplotlib`` uses ``AnyWidget`` as the underlying widget framework. This means that it can be used in any |
49 | | - environment that supports ``AnyWidget``, including Jupyter notebooks, JupyterLab, and PyCharm notebook preview. Under |
50 | | - the hood, ``AnyWidget`` uses a pure-JavaScript implementation of the widget protocol, which allows for fast rendering |
51 | | - and interactivity. |
| 38 | + :octicon:`zap;2em;sd-text-info` Examples |
| 39 | + ^^^ |
52 | 40 |
|
53 | | -**Status**: anyplotlib v0.1.0 provides a lightweight, interactive alternative to matplotlib's |
54 | | -pyplot interface for Jupyter notebooks and compatible environments. Performance is optimized for |
55 | | -real-time interactivity with large datasets on canvas-based rendering. |
| 41 | + Gallery of short, self-contained examples showing 1-D signals, 2-D images, |
| 42 | + 3-D surfaces, bar charts, interactive widgets, and more. |
56 | 43 |
|
57 | 44 | .. toctree:: |
58 | 45 | :hidden: |
| 46 | + :maxdepth: 2 |
| 47 | + |
| 48 | + getting_started |
| 49 | + api/index |
| 50 | + auto_examples/index |
59 | 51 |
|
60 | 52 | * :ref:`genindex` |
61 | 53 | * :ref:`modindex` |
62 | 54 | * :ref:`search` |
63 | | - |
0 commit comments