Skip to main content

Automatically add multiple x-axis labels to your matplotlib subplots.

Project description

manylabels collage

manylabels

Many plots in the heliophysics science community are of satellites showing various physical observations. To place these observations in context, scientists often include multiple x-axis labels showing, for example, the satellite location. This is surprisingly hard to implement using matplotlib. Nevertheless, manylabels.ManyLabels() class provides this functionality.

Installation

$ python -m pip install manylabels

Example

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import manylabels

n = 100
x = np.array([pd.Timestamp(2000,1,1,5,0,0) + pd.Timedelta(minutes=i) for i in range(n)])
y = np.random.rand(n)

data = pd.DataFrame(
    index=x,
    data={
        'x':np.linspace(0, 10, num=n),
        'y':np.linspace(10, 20, num=n),
        'z':np.linspace(-5, 5, num=n)
        }
    )

fig, ax = plt.subplots()
ax.plot(x, y)
manylabels.ManyLabels(ax, data)
plt.show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manylabels-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

manylabels-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file manylabels-0.1.0.tar.gz.

File metadata

  • Download URL: manylabels-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for manylabels-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98daa7e9cf9c80aa6455c4e9ae64d695dbcc60440b1733fde763d8c1815471fb
MD5 f28d53de4fa85a1817ae9128af1f6dba
BLAKE2b-256 307603727c2d2cf10875ee0c3c6479d9ba41b550fb905a5a537efb325e15afb9

See more details on using hashes here.

File details

Details for the file manylabels-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: manylabels-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for manylabels-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53f6cfacc73e7d38977c339ea510bad2cd7358449565eea02ab57f8aa61b7bf9
MD5 a210f2718412de9362b75c4f276526a5
BLAKE2b-256 46d1372a70705e90a4f42f76cfbe0d02bf3c3740b1949038445853fbfffcf16b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page