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
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.0.tar.gz (14.3 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.4.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nc-time-axis-1.4.0.tar.gz
  • Upload date:
  • Size: 14.3 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.0.tar.gz
Algorithm Hash digest
SHA256 d64847b930261b6793040b5fe5195f8ee90a2e57aadce9b2df692ca35de74b92
MD5 b35d52bd8c04ba03dea512314cb8f699
BLAKE2b-256 d167e87fa7b97d1132c533fe76734e1af46e5c69f0428af8f61976987eadc9ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nc_time_axis-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f39dc5faca2a7ec9952904b5a5b88ee8dadbf41c7a2e42584eef53a1b8ee4577
MD5 da9b95420ae2eac460425ff8e9fc099e
BLAKE2b-256 366189996e46426441ea454ccc3a557bf37e8d5ffa6efdb7c397b739dbc0f253

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