daaf-plot


Namedaaf-plot JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryPersonal python toolbox to make interactive plot in python notebooks
upload_time2025-10-22 11:33:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords interactive plots notebooks visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # daaf-plot

[![PyPI version](https://badge.fury.io/py/daaf-plot.svg)](https://badge.fury.io/py/daaf-plot)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

`daaf-plot` is a python toolbox to make interactive plot in python notebooks.

## Installation

Install using `pip`:

    $ pip install daaf-plot

## Usage

The primary goal of the present toolbox is to help the creation of interactive plots.
Nevertheless, it also provides a function to open a `matplotlib` figure from a given list
of settings (number of rows and columns, padding, etc.) as well as some stylistic options
which can be used outside python notebooks.

### Interactive plots

To make an interactive plot, you need:
1. to enable the `%matplotlib widget` magic in a notebook;
2. an `xarray.DataArray` containing the data to plot.

Import `InteractiveLinePlot` or `InteractivePColorMesh` from `daaf_plot.figure`, instantiate with:

    >>> fig = InteractiveLinePlot(
    ...     data_array,
    ...     x_dim='the_x_dim',
    ...     line_dim='the_line_dim',
    ...     facet_dim=...,
    ...     open_figure_kwargs=dict(...),
    ... )

for a line plot and with:

    >>> fig = InteractivePColorMesh(
    ...     data_array,
    ...     x_dim='the_x_dim',
    ...     y_dim='the_y_dim',
    ...     facet_dim=...
    ...     open_figure_kwargs=dict(...),
    ... )

for a pcolormesh. This creates an abstract figure object, which you can then open using:

    >>> fig.interactive_show()

Have at look at the examples in the `examples/` repository!

### Open a matplotlib figure

The `daaf_plot.geometry.open_figure()` function can be used to open a `matplotlib` figure,
even outside python notebooks.

### Stylistic options

Some `matplotlib` stylistic options are provided when importing `daaf_plot.style`:
- scale `linlogp`;
- color map `deep` (from `seaborn`) and its reversed counterpart;
- a unified function `daaf_plot.style.set_font_size()` to set font size in figures;
- ...

In addition, my custom style sheet is stored in `src/daaf_plot/style/laptop.mplstyle`
and can be used as follows:

    >>> import matplotlib.pyplot as plt
    >>> plt.style.use('daaf_plot.style.laptop')

## Todo-list

- write docstrings
- write documentation
- add type hints

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "daaf-plot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "interactive plots, notebooks, visualization",
    "author": null,
    "author_email": "Alban Farchi <alban.farchi@ecmwf.int>",
    "download_url": "https://files.pythonhosted.org/packages/a4/f9/de71434c3b60b4501167f8d51a5ae9f9f1e8e90a1abc5c5176c03e3f0c80/daaf_plot-1.0.1.tar.gz",
    "platform": null,
    "description": "# daaf-plot\n\n[![PyPI version](https://badge.fury.io/py/daaf-plot.svg)](https://badge.fury.io/py/daaf-plot)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n`daaf-plot` is a python toolbox to make interactive plot in python notebooks.\n\n## Installation\n\nInstall using `pip`:\n\n    $ pip install daaf-plot\n\n## Usage\n\nThe primary goal of the present toolbox is to help the creation of interactive plots.\nNevertheless, it also provides a function to open a `matplotlib` figure from a given list\nof settings (number of rows and columns, padding, etc.) as well as some stylistic options\nwhich can be used outside python notebooks.\n\n### Interactive plots\n\nTo make an interactive plot, you need:\n1. to enable the `%matplotlib widget` magic in a notebook;\n2. an `xarray.DataArray` containing the data to plot.\n\nImport `InteractiveLinePlot` or `InteractivePColorMesh` from `daaf_plot.figure`, instantiate with:\n\n    >>> fig = InteractiveLinePlot(\n    ...     data_array,\n    ...     x_dim='the_x_dim',\n    ...     line_dim='the_line_dim',\n    ...     facet_dim=...,\n    ...     open_figure_kwargs=dict(...),\n    ... )\n\nfor a line plot and with:\n\n    >>> fig = InteractivePColorMesh(\n    ...     data_array,\n    ...     x_dim='the_x_dim',\n    ...     y_dim='the_y_dim',\n    ...     facet_dim=...\n    ...     open_figure_kwargs=dict(...),\n    ... )\n\nfor a pcolormesh. This creates an abstract figure object, which you can then open using:\n\n    >>> fig.interactive_show()\n\nHave at look at the examples in the `examples/` repository!\n\n### Open a matplotlib figure\n\nThe `daaf_plot.geometry.open_figure()` function can be used to open a `matplotlib` figure,\neven outside python notebooks.\n\n### Stylistic options\n\nSome `matplotlib` stylistic options are provided when importing `daaf_plot.style`:\n- scale `linlogp`;\n- color map `deep` (from `seaborn`) and its reversed counterpart;\n- a unified function `daaf_plot.style.set_font_size()` to set font size in figures;\n- ...\n\nIn addition, my custom style sheet is stored in `src/daaf_plot/style/laptop.mplstyle`\nand can be used as follows:\n\n    >>> import matplotlib.pyplot as plt\n    >>> plt.style.use('daaf_plot.style.laptop')\n\n## Todo-list\n\n- write docstrings\n- write documentation\n- add type hints\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Personal python toolbox to make interactive plot in python notebooks",
    "version": "1.0.1",
    "project_urls": {
        "Issues": "https://github.com/aFarchi/daaf-plot/issues",
        "Source": "https://github.com/aFarchi/daaf-plot"
    },
    "split_keywords": [
        "interactive plots",
        " notebooks",
        " visualization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7099e5952326d60dff20c45ea5140e63c146321865a01af0f418bfe9d3aad9cb",
                "md5": "fd510f24b80110a96e30f947a1615ce4",
                "sha256": "abe3a95dc985f9303e2645d3e05f586240651e26fc46a60197f6de7866b83d67"
            },
            "downloads": -1,
            "filename": "daaf_plot-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fd510f24b80110a96e30f947a1615ce4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 18412,
            "upload_time": "2025-10-22T11:33:21",
            "upload_time_iso_8601": "2025-10-22T11:33:21.215576Z",
            "url": "https://files.pythonhosted.org/packages/70/99/e5952326d60dff20c45ea5140e63c146321865a01af0f418bfe9d3aad9cb/daaf_plot-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a4f9de71434c3b60b4501167f8d51a5ae9f9f1e8e90a1abc5c5176c03e3f0c80",
                "md5": "6d6e86ab4946e72ad8f9fe0db343c93f",
                "sha256": "7f18298c02540ff663e5a7e0dadad21f578a48265d04f2b9eef0d069d1f6e7aa"
            },
            "downloads": -1,
            "filename": "daaf_plot-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6d6e86ab4946e72ad8f9fe0db343c93f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 11711954,
            "upload_time": "2025-10-22T11:33:40",
            "upload_time_iso_8601": "2025-10-22T11:33:40.815260Z",
            "url": "https://files.pythonhosted.org/packages/a4/f9/de71434c3b60b4501167f8d51a5ae9f9f1e8e90a1abc5c5176c03e3f0c80/daaf_plot-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-22 11:33:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aFarchi",
    "github_project": "daaf-plot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "daaf-plot"
}
        
Elapsed time: 1.80570s