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

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.0
File Size Uploaded
cedarkit_plots-2026.9.0.tar.gz 2.3 MB Details

Built distribution (wheel)

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

Total release size: 4.4 MB

Release files / cedarkit_plots-2026.9.0.tar.gz

Download URL cedarkit_plots-2026.9.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
912e4bce984e79f1d05ba19d98e12e96a0b237e2dd399525675d0549fd368e29
BLAKE2b-256 checksum
How to use checksums
f760d0f33b34ae8247b36e1f558d6c4b5e6ab99c843e5b9f4391e3bdd308693f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL cedarkit_plots-2026.9.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
89bbc18c7fc5ece3e84cffbe462dd80a03d1faacbdb597215e042097455198ab
BLAKE2b-256 checksum
How to use checksums
55773dfa43f4a367280f56630ea1fc3777405ece281268db6b1742c6b7923512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2026.9.0 This release

2 release files

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