Provides support for a cftime axis in matplotlib
Project Links
Meta
Author: SciTools Developers
Requires Python: >=3.7
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Science/Research
License
- OSI Approved :: BSD License
Operating System
- MacOS
- Microsoft :: Windows
- POSIX :: Linux
- Unix
Programming Language
- Python :: 3 :: Only
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
Topic
- Scientific/Engineering
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.
Apr 20, 2022
1.4.1
Oct 23, 2021
1.4.0
Jun 14, 2021
1.3.1
Jun 11, 2021
1.3.0
Oct 18, 2019
1.2.0
May 31, 2018
1.1.0
Oct 23, 2017
1.0.2