Skip to content

SciTools/nc-time-axis

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1883671 Β· Aug 3, 2024
Jul 30, 2024
Jan 3, 2024
Aug 3, 2024
Jan 29, 2024
Aug 18, 2021
Jun 27, 2016
Jun 10, 2021
Jun 17, 2024
Apr 26, 2023
May 24, 2023
Feb 22, 2024
May 6, 2023
May 6, 2023
May 6, 2023
May 6, 2023
Nov 4, 2021
Jun 3, 2024
Jun 10, 2021

Repository files navigation

nc-time-axis

Support for a cftime axis in matplotlib

βš™οΈ CI ci-citation ci-locks ci-manifest ci-wheels pre-commit.ci status
πŸ’¬ Community GH Discussions
πŸ“– Documentation RTD Status
πŸ“ˆ Health codecov
✨ Meta code style - black license - bds-3-clause
πŸ“¦ Package DOI conda-forge pypi pypi - python version
🧰 Repo contributors

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()

alt text

License

nc-time-axis is distributed under the terms of the BSD-3-Clause license.

Graphics and Lead Scientist: Ed Hawkins, National Centre for Atmospheric Science, University of Reading.

Data: Berkeley Earth, NOAA, UK Met Office, MeteoSwiss, DWD, SMHI, UoR, Meteo France & ZAMG.

#ShowYourStripes is distributed under a Creative Commons Attribution 4.0 International License creative-commons-by