Skip to main content

cedarkit-plots

Maturity-Sandbox GitHub Release PyPI - Version GitHub License GitHub Action Workflow Status

A plotting tool for meteorology data.

Install

Install using pip:

pip install cedarkit-plots

Or download the latest source code from GitHub and install manually.

Getting started

The following example uses CMA-GFS data to draw a 2m temperature contour fill plot.

Set some variables:

import pandas as pd

graph_name = "2m Temperature (C)"
system_name = "CMA-GFS"
start_time = pd.to_datetime("2024-11-09")
forecast_time = pd.to_timedelta("24h")

Get local data file path using reki:

from reki.data_finder import find_local_file

data_file_path = find_local_file(
    "cma_gfs_gmf/grib2/orig",
    start_time=start_time,
    forecast_time=forecast_time,
)

Load 2m temperature field from file and convert unit:

from reki.format.grib.eccodes import load_field_from_file

field_t_2m = load_field_from_file(
    data_file_path,
    parameter="2t",
) - 273.15

Create contour style, including levels and colormap. In this example, a NCL colormap embedded in the project is used.

import numpy as np
import matplotlib.colors as mcolors
from cedarkit.plots.colormap import get_ncl_colormap
from cedarkit.plots.style import ContourStyle

t_2m_level = [-24, -20, -16, -12, -8, -4, 0, 4, 8, 12, 16, 20, 24, 28, 32]

color_map = get_ncl_colormap("BlAqGrYeOrReVi200")
color_index = np.array([2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 102, 112, 122, 132, 142, 152]) - 2
t_2m_color_map = mcolors.ListedColormap(color_map(color_index))

t_2m_style = ContourStyle(
    colors=t_2m_color_map,
    levels=t_2m_level,
    fill=True,
)

Create a build-in template EastAsiaMapTemplate. A template is a pre-defined layout to put title, text info, colorbar in some position.

from cedarkit.plots.domains import EastAsiaMapTemplate

domain = EastAsiaMapTemplate()

Create plot panel and plot the field:

from cedarkit.plots.chart import Panel

panel = Panel(domain=domain)
panel.plot(field_t_2m, style=t_2m_style)

Add title and colorbar:

domain.set_title(
    panel=panel,
    graph_name=graph_name,
    system_name=system_name,
    start_time=start_time,
    forecast_time=forecast_time,
)
domain.add_colorbar(panel=panel, style=t_2m_style)

Show the picture:

panel.show()

LICENSE

Copyright © 2021-2026, developers at cemc-oper.

cedarkit-plots is licensed under Apache License V2.0

Third party

cedarkit/plots/resources/map/china-shapefiles is from project dongli/china-shapefiles.

cedarkit/plots/resources/colormap/ncl is from project NCL.

Metadata

Release files for cedarkit-plots 2026.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cedarkit-plots 2026.9.1
File Size Uploaded Provenance Actions
cedarkit_plots-2026.9.1.tar.gz 2.3 MB Without provenance Details for cedarkit_plots-2026.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cedarkit-plots 2026.9.1
File Interpreter ABI Platform Actions
cedarkit_plots-2026.9.1-py3-none-any.whl Python 3 none any Details for cedarkit_plots-2026.9.1-py3-none-any.whl

Total release size: 4.4 MB

Release files / cedarkit_plots-2026.9.1.tar.gz

Download URL cedarkit_plots-2026.9.1.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
d88d76e5c37588affef80a28917e639abe293811c6724fbad1edfc5084424108
BLAKE2b-256 checksum
How to use checksums
109bf03292cf1af2183bdddc98259fcbbfdf4b2abcaf58743ed35df0eb778c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / cedarkit_plots-2026.9.1-py3-none-any.whl

Download URL cedarkit_plots-2026.9.1-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
724cf927edd6d98b984425f6c9797e30653fa0930fa749035f0f039793811de8
BLAKE2b-256 checksum
How to use checksums
f9b7ddbbc296760934f0fa449ba4254b76aa302e52e0b0fc3c0bc17d9f6cdeb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for cedarkit-plots 2026.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page