Metadata-Version: 2.4
Name: cf-plot
Version: 3.6.0
Summary: Code-light plotting for earth science and aligned research
Author: Andy Heaps, Bryan Lawrence
Author-email: Sadie Bartholomew <sadie.bartholomew@ncas.ac.uk>
Maintainer-email: Sadie Bartholomew <sadie.bartholomew@ncas.ac.uk>
License-Expression: MIT
Project-URL: Homepage, https://ncas-cms.github.io/cf-plot/
Project-URL: Documentation, https://ncas-cms.github.io/cf-plot/
Project-URL: Source, https://github.com/NCAS-CMS/cf-plot
Project-URL: Download, https://pypi.org/project/cf-plot/
Project-URL: Installation, https://ncas-cms.github.io/cf-plot/installation.html
Project-URL: Release Notes, https://github.com/NCAS-CMS/cf-plot/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/NCAS-CMS/cf-plot/issues
Keywords: visualisation,visualization,scientific-visualisation,scientific-visualization,atmospheric-science,meteorology,earth-science,climate-science,geoscience,oceanography,cartography,cf-conventions,cf,data-analysis,netcdf,zarr
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: Oceanography
Classifier: Topic :: Scientific/Engineering :: Hydrology
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: cf-python>=3.17.0
Requires-Dist: cartopy>=0.22.0
Dynamic: license-file

# cf-plot

## Code-light plotting for earth science and aligned research

### Overview

![cf-plot example gallery of plots](docs/source/images/new_gallery_view.png "Examples Gallery of plots made with the cf-plot library")

**cf-plot allows you to produce and customise publication-quality contour,
vector, line and more plots with the power of Python,
[matplotlib](https://matplotlib.org/),
[Cartopy](https://scitools.org.uk/cartopy/docs/latest/) and
[cf-python](https://ncas-cms.github.io/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](https://cms.ncas.ac.uk/index.html) group, part of
[NCAS](https://ncas.ac.uk/).


### 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:

```python
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](https://ncas-cms.github.io/cf-plot/gallery_of_examples.html),
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/)
(`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`:

```bash
pip install cf-python cf-plot
```

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

```bash
conda install -c ncas -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)
(`https://ncas-cms.github.io/cf-plot/installation.html`)
of the documentation.

### Testing

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

``` bash
$ 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.

```console
$ # 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.

```console
$ 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](https://github.com/NCAS-CMS/cf-plot/blob/main/.github/CONTRIBUTING.md) which is
copied into the [documentation here](https://ncas-cms.github.io/cf-plot/support.html#contributing-to-cf-plot).


### Help: Issues, Questions, Feature Requests, etc.

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