Provides support for a cftime axis in matplotlib
Project description
nc-time-axis
Support for a cftime axis in matplotlib
Installation
Install nc-time-axis
either with conda
:
conda install -c conda-forge nc-time-axis
Or pip
:
pip install nc-time-axis
Example
import random
import cftime
import matplotlib.pyplot as plt
import nc_time_axis
calendar = "360_day"
dt = [
cftime.datetime(year=2017, month=2, day=day, calendar=calendar)
for day in range(1, 31)
]
temperatures = [round(random.uniform(0, 12), 3) for _ in range(len(dt))]
plt.plot(dt, temperatures)
plt.margins(0.1)
plt.ylim(0, 12)
plt.xlabel("Date")
plt.ylabel("Temperature")
plt.show()
Reference
- cftime - Time-handling functionality from netcdf4-python.
- matplotlib - Plotting with Python.
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
nc-time-axis-1.4.1.tar.gz
(66.2 kB
view details)
Built Distribution
File details
Details for the file nc-time-axis-1.4.1.tar.gz
.
File metadata
- Download URL: nc-time-axis-1.4.1.tar.gz
- Upload date:
- Size: 66.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72d80f492f34bbf59490838d8cb3d92f14e88900b0ee35498b2b33c82795eb81 |
|
MD5 | ac5df48dfb774c27d57b6464ef2cdeaf |
|
BLAKE2b-256 | 39c7ceaba2047ef4e08660a5a89a71cea30547bddb0e51236dab2dcb771a6fe1 |
File details
Details for the file nc_time_axis-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: nc_time_axis-1.4.1-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a6fb28cede0d07998fcd666599f76e51a086e1929fbcbfb758c1d0f3e7b0d1 |
|
MD5 | 4b250acc4fad0adb1be71182d54a2a07 |
|
BLAKE2b-256 | 0189dbeab77a217f8fbda97a637acf1e3f0ce8c9c9fb3f5e5d1ff843da859520 |