GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NCAS-CMS/cf-plot: Code-light plotting for earth science and aligned research

BranchesTags
Open more actions menu

Latest commit

 

History

887 Commits
887 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
_developer_docs
_developer_docs
 
 
cfplot
cfplot
 
 
docs
docs
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.txt
LICENSE.txt
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
cfplot-test-env.yml
cfplot-test-env.yml
 
 
pyproject.toml
pyproject.toml
 
 
pytest.ini
pytest.ini
 
 

Repository files navigation

cf-plot

Code-light plotting for earth science and aligned research

Category Click badge for further information...
Package PyPI Conda Python versions
Documentation Documentation
Repository release contributors commits-since
Testing & CI Tests Image comparison tests Linting and formatting
Quality Status
Community Contributing Code of Conduct
Licence MIT Licence

Overview

cf-plot example gallery of plots

cf-plot allows you to produce and customise publication-quality contour, vector, line and more plots with the power of Python, matplotlib, Cartopy and cf-python, in as few lines of code as possible.

It is designed to be a useful visualisation tool for environmental, earth and aligned sciences, for example to facilitate climate and meteorological research. cf-plot is developed and maintained by the NCAS-CMS group, part of NCAS.

Brief Demonstration

In as little as four lines of Python including imports and file reading, using cf-plot you can for example produce a contour plot showing a 2D subspace of a netCDF dataset:

import cf
import cfplot as cfp
f = cf.read('<dataset name>.nc')[0]  # picks out a read-in field of the dataset
cfp.con(f.subspace(time=<chosen time value>))  # creates a contour plot of the field at that time value

Examples Gallery

A gallery of outputs made with cf-plot, showcasing a range of plotting possibilities with links to relevant documentation pages and to example code, can be found on this dedicated page within the documentation, as illustrated in the (static) image at the top of this document.

Documentation

See the cf-plot homepage (https://ncas-cms.github.io/cf-plot) for the full online documentation.

Installation

To install cf-plot with its required dependencies, you can use pip:

pip install cf-plot

or you can use conda (or similar package managers such as mamba) as follows (or equivalent):

conda install -c conda-forge cf-python cf-plot udunits2

More detail about installation is provided on the installation page (https://ncas-cms.github.io/cf-plot/installation.html) of the documentation.

Testing

To run the full test suite, call from the repo root:

$ pytest tests

Note however this calls image comparison testing on plot outputs and exact image comparison depends on the environment (libraries and versions) used. So they may fail if your environment differs from that which was used to generate the reference images. Therefore, to allow like-for-like comparison, a specific testing conda environment is provided, cfplot-test-env.yml. With this environment enabled, the image comparison should pass. Note we recommend use of mamba for environment creation/solving, but conda will also work.

$ # Deactivate all other environments present first
$ mamba env create --file cfplot-test-env.yml --name cfplot-test-env
$ conda activate cfplot-test-env
$ pytest tests

However you can disable this aspect with the --skip-image-comparison or equivalently -I option to the cf-plot test suite run with pytest, so that only the functional tests run. This is advised when you use any environment other than the above, except where some library version differs for the purpose of regression testing on that versioning change.

$ pytest tests -I

Note

More comprehensive testing across different environments is under development but is not yet available. For now, use the reference environment to test with.

Contributing

Everyone is welcome to contribute to cf-plot in the form of bug reports, documentation, code, design proposals, and more.

Contributing guidelines are available in a dedicated document which is copied into the documentation here.

Help: Issues, Questions, Feature Requests, etc.

For any queries, see the guidance page (https://ncas-cms.github.io/cf-plot/support.html).

About

Code-light plotting for earth science and aligned research

ncas-cms.github.io/cf-plot

Topics

atmospherecfclimateclimate-dataclimate-data-analysisclimate-data-visualizationdata-visualisationdata-visualizationnetcdfoceanpythonvisualisationvisualization

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

21 stars

Watchers

3 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.