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

from nc_time_axis import CalendarDateTime

calendar = "360_day"
dt = [
    cftime.datetime(year=2017, month=2, day=day, calendar=calendar)
    for day in range(1, 31)
]
cdt = [CalendarDateTime(item, calendar) for item in dt]
temperatures = [round(random.uniform(0, 12), 3) for _ in range(len(cdt))]

plt.plot(cdt, 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.3.0.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nc_time_axis-1.3.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file nc-time-axis-1.3.0.tar.gz.

File metadata

  • Download URL: nc-time-axis-1.3.0.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.0

File hashes

Hashes for nc-time-axis-1.3.0.tar.gz
Algorithm Hash digest
SHA256 2aab606c7917b7263a6c05e91706449802181f9410a8d7cf6dc69b1092925364
MD5 43fe2ec1ad94bcb2c1e8701fdf5a1fc6
BLAKE2b-256 802165973d79511e8c4efc9fc07b523af69177b7e2c78256c3786abb930494e3

See more details on using hashes here.

File details

Details for the file nc_time_axis-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: nc_time_axis-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.0

File hashes

Hashes for nc_time_axis-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58a6cd61b8ace02fd44b576fa6c0a9a7794df4af5aaa59d18dfffd336ad10ecb
MD5 cda6b6b03717ba9c21e26345a87f02cf
BLAKE2b-256 63f960e37aeb7e5a66f73f6cecda1b8c9029ab702e400b874dabc0608cb46f63

See more details on using hashes here.

Supported by

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