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 hashes)
Built Distribution
Close
Hashes for nc_time_axis-1.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a6fb28cede0d07998fcd666599f76e51a086e1929fbcbfb758c1d0f3e7b0d1 |
|
MD5 | 4b250acc4fad0adb1be71182d54a2a07 |
|
BLAKE2b-256 | 0189dbeab77a217f8fbda97a637acf1e3f0ce8c9c9fb3f5e5d1ff843da859520 |