Automatically add multiple x-axis labels to your matplotlib subplots.
Project description
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.0.3.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file manylabels-0.0.3.tar.gz
.
File metadata
- Download URL: manylabels-0.0.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b84a648b2a9ea378f850a101717d6499320f229e2582660a389313e7e8e183 |
|
MD5 | 4a5240d7f9c17b7ee2f8be6cfdac31b7 |
|
BLAKE2b-256 | a036f9b46a3f48c19ba64c810f632f0c10b0ad20bb4a2253ecc071704d113281 |
File details
Details for the file manylabels-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: manylabels-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d10c822e6ab373602d2d629e35a43b1f6ab486fd0693c967a0d6f03484c22978 |
|
MD5 | 57d99b7263cd82123ef6d139516cdca7 |
|
BLAKE2b-256 | f8245539d138d9351382068418675b297cc1f3cf41093daf5a704281a77cbf84 |