Skip to main content

Provides support for a cftime axis in matplotlib

Project description

nc-time-axis

Support for a cftime axis in matplotlib

cirrus-ci Documentation Status codecov pre-commit.ci conda-forge pypi black license 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

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)

Uploaded Source

Built Distribution

nc_time_axis-1.4.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

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

Hashes for nc-time-axis-1.4.1.tar.gz
Algorithm Hash digest
SHA256 72d80f492f34bbf59490838d8cb3d92f14e88900b0ee35498b2b33c82795eb81
MD5 ac5df48dfb774c27d57b6464ef2cdeaf
BLAKE2b-256 39c7ceaba2047ef4e08660a5a89a71cea30547bddb0e51236dab2dcb771a6fe1

See more details on using hashes here.

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

Hashes for nc_time_axis-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 96a6fb28cede0d07998fcd666599f76e51a086e1929fbcbfb758c1d0f3e7b0d1
MD5 4b250acc4fad0adb1be71182d54a2a07
BLAKE2b-256 0189dbeab77a217f8fbda97a637acf1e3f0ce8c9c9fb3f5e5d1ff843da859520

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page