Skip to main content

daaf-plot

PyPI version License: 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

Metadata

Release files for daaf-plot 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for daaf-plot 1.1.1
File Size Uploaded
daaf_plot-1.1.1.tar.gz 13.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for daaf-plot 1.1.1
File Interpreter ABI Platform
daaf_plot-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 MB

Release files / daaf_plot-1.1.1.tar.gz

Download URL daaf_plot-1.1.1.tar.gz
Size 13.8 MB
Tags Source
SHA-256 checksum
How to use checksums
6f400e0bd6db13002bba1d174eae823f2aec506865c2463a23ae1a7619f21be3
BLAKE2b-256 checksum
How to use checksums
eefeb9e92969c0fb4183abe146980ad04590def6421b1951b0227e7eae3cadb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / daaf_plot-1.1.1-py3-none-any.whl

Download URL daaf_plot-1.1.1-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b02f07782ae117f2a4e9a0ff48cf94e1ec2982b32ce60b223a235f4d7d122862
BLAKE2b-256 checksum
How to use checksums
4b30bf39b1f6a2e65a70aeb26d81d3b21d81792ce7d8a1a89df85be887aff47d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page