skillfed

nc-time-axis

Provides support for a cftime axis in matplotlib

nc-time-axis v1.4.1 184.4K downloads/30d#10,038 on PyPI59
Permissive license BSD 3-Clause Active released

What it is and what it does

nc-time-axis is a small integration layer that teaches matplotlib how to handle cftime datetime objects on plot axes. It's designed for scientists and climate modelers who work with data from netCDF files, which often use non-standard calendars that standard Python datetime cannot represent. The package registers cftime objects as a valid matplotlib axis type, so you can pass them directly to plot functions without manual conversion.

The package depends on cftime for calendar handling, matplotlib for plotting, and numpy for array operations. It's actively maintained, supports Python 3.7 and later, and has no known security vulnerabilities. Installation is straightforward via pip or conda, and it requires no system dependencies or configuration.

Use it for:

  • Plot climate model output with non-standard calendars directly from netCDF files without converting to standard datetime.
  • Create time-series visualizations of weather or oceanographic data that use non-Gregorian calendars.
  • Automate axis formatting for scientific publications involving climate or paleoclimate data.
  • Build data exploration notebooks for earth science research where cftime objects are native to the data source.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Enables matplotlib to plot data using cftime calendar objects on the x-axis, supporting non-standard calendars used in climate and weather modeling.

Yes. If you work with climate, weather, or earth science data in netCDF format, this package solves a real friction point—plotting cftime objects directly without conversion. It has low install friction, no vulnerabilities, permissive licensing, and active maintenance. If you don't use cftime calendars, it adds no value.

Install

nc-time-axis on PyPI

pip

pip install nc-time-axis

uv

uv add nc-time-axis

poetry

poetry add nc-time-axis

Installing nc-time-axis

Before you install

Low friction installation as a pure Python wheel. Actively maintained with recent commits; last release was in 2022 but repository remains active with ongoing development.

License in practice

BSD 3-Clause permissive license allows use in commercial and private projects with minimal restrictions beyond attribution.

Quickstart

pip install nc-time-axis

import cftime
import matplotlib.pyplot as plt
import nc_time_axis

dt = [cftime.datetime(2017, 2, day, calendar="360_day") for day in range(1, 31)]
plt.plot(dt, [1, 2, 3])  # cftime objects now work on x-axis
plt.show()

Verify before relying

  • Whether the package handles all cftime calendar types or only a subset of the calendars supported by cftime itself.
  • Performance characteristics when plotting large datasets with non-standard calendars.
  • Support for calendar types beyond 360-day calendars.

Package facts

License BSD 3-Clause (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 3 — cftime, matplotlib, numpy
Maintenance actively maintained — 1,577 days since the last release
Last repo commit
First released
Downloads 184,419/month — #10,038 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nc_time_axis-1.4.1-py3-none-any.whl

Keywords: axis, cftime, matplotlib

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering

Tags

cftime matplotlib axisclimate calendar plottingnon-standard calendar datesnetcdf time axis360-day calendar plot
climate-sciencematplotlib-extension

More Scientific/Engineering packages