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(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.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

manylabels-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manylabels-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for manylabels-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fa4d7fa194f6ec5c733bfd6e64cc3faa499ed41e22c64bc71a3ba5066c46e728
MD5 89d5695cedc04612ae23e0fb41dfa8dd
BLAKE2b-256 0aea0020fff288af9a2b5c29f802cd14233308dfdded87ecd5ad7db5e429a4b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: manylabels-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for manylabels-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac516dc6b3ae8c9d6d1231f67c947ca8248aae620aa5e4f477139710765af345
MD5 6e49cc21a0a899ddea41599419141bf6
BLAKE2b-256 a1eb5e3c9fd17c33f31abc38b27971d65339c623ae41d99682a77bb01037caf5

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