Skip to content

Commit 6514268

Browse files
committed
Update release notes to expand on the new plotting API
1 parent 656fdbd commit 6514268

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

docs/releases/1.0.0a1.rst

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,34 @@ These methods were little used and backwards compatibility was complicated.
2929
To make the transition smoother the assumption of a default polygon grid has been maintained,
3030
however this default may be removed in future releases.
3131

32-
This change allows for plotting variables that are not defined on a polygon grid
33-
all using the same API.
34-
A new method :meth:`.Convention.make_artist` has been added
35-
which will pick the correct matplotlib :class:`~matplotlib.artist.Artist` to plot a given variable.
36-
Now :class:`~.conventions.ugrid.UGrid` datasets can plot variables defined on face grids and node grids
37-
using the same API.
38-
All artists returned by :meth:`~.Convention.make_artist`
39-
have a :meth:`~.GridArtist.set_data_array` that can update the data drawn by an artist
40-
which provides a consistent interface for making animations.
41-
42-
:ref:`More examples <examples>` have been added to the documentation to demonstrate this new functionality.
43-
4432
.. _ugrid: https://ugrid-conventions.github.io/ugrid-conventions/
4533
.. _compas: https://research.csiro.au/cem/software/ems/hydro/unstructured-compas/
4634
.. _schism: https://ccrm.vims.edu/schismweb/
4735

36+
Improved plotting API
37+
=====================
38+
39+
The plotting API has been improved to achieve the goals:
40+
41+
* The ability to plot variables defined on non-polygonal grids,
42+
* Make customisation of artist properties easier, such as colour maps and data limits,
43+
* Provide a consistent API for updating the data for an artist, to make animated plots simpler,
44+
* Support plotting on multiple axes in a figure, and
45+
* Support more kinds of artists, such as contour plots over polygonal grids.
46+
47+
A new method :meth:`.Convention.make_artist` has been added
48+
which will pick the correct matplotlib :class:`~matplotlib.artist.Artist` to plot a given variable.
49+
This method will pass any kwargs on to the underlying artist allowing for easy customisation
50+
(see :ref:`sphx_glr_examples_plot-with-clim.py`).
51+
This method takes an :class:`~matplotlib.axes.Axes` instance allowing for multiple axes on one figure
52+
(see :ref:`sphx_glr_examples_plot-two-subplots.py`).
53+
It will return a :class:`~.plot.artists.GridArtist` instance which has a :meth:`.GridArtist.set_data_array` method.
54+
Users can call this method to update the data being plotted in an animation
55+
without the artist-specific handling previously required in :func:`~.plot.animate_on_figure`
56+
(see :ref:`sphx_glr_examples_plot-animation.py`).
57+
58+
:ref:`More examples <examples>` are being added over time to demonstrate how to make more customised plots.
59+
4860
Changelog
4961
=========
5062

@@ -81,4 +93,8 @@ Changelog
8193
(:pr:`208`).
8294
* The handling of multiple grid kinds was rewritten from the ground up
8395
to properly support conventions like `unstructured grids <ugrid_>`_
84-
(:pr:`205`, also :issue:`189`, :issue:`175`, :issue:`121`, and :pr:`187`).
96+
using the new :meth:`.Convention.grids` property
97+
(:pr:`205`, also :issue:`189`).
98+
* A new method :meth:`Convention.make_artist()` improves the plotting capabilities,
99+
supporting plotting variables on all grids supported by the convention
100+
(:pr:`205`, :pr:`210`, :pr:`211`, :issue:`175`, :issue:`121`, and :pr:`187`).

0 commit comments

Comments
 (0)