diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f7cfe355..8dbc8e6a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ deps-run: &deps-install command: | conda install -n test-environment --quiet \ cython \ - matplotlib \ + 'matplotlib>3.3' \ numpy \ owslib \ pillow \ diff --git a/docs/source/_static/version_switch.js b/docs/source/_static/version_switch.js index 5cc32344b..b4278b6b3 100644 --- a/docs/source/_static/version_switch.js +++ b/docs/source/_static/version_switch.js @@ -5,7 +5,8 @@ 'use strict'; var all_versions = { - 'latest': '0.18', + 'latest': '0.19', + 'v0.18': '0.18', 'v0.17': '0.17', 'v0.16': '0.16', 'v0.15': '0.15', diff --git a/docs/source/conf.py b/docs/source/conf.py index 8e37b699f..33c9b03bc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -82,16 +82,16 @@ release = cartopy.__version__ -if (hasattr(owslib, '__version__') and - LooseVersion(owslib.__version__) >= '0.19.2'): - expected_failing_examples = [] -else: - # OWSLib WMTS support is broken. - expected_failing_examples = [ - '../../examples/web_services/reprojected_wmts.py', - '../../examples/web_services/wmts.py', - '../../examples/web_services/wmts_time.py', - ] +# if (hasattr(owslib, '__version__') and +# LooseVersion(owslib.__version__) >= '0.19.2'): +# expected_failing_examples = [] +# else: +# OWSLib WMTS support is broken. +expected_failing_examples = [ + '../../examples/web_services/reprojected_wmts.py', + '../../examples/web_services/wmts.py', + '../../examples/web_services/wmts_time.py', +] subsection_order = ExplicitOrder(['../../examples/lines_and_polygons', '../../examples/scalar_data', @@ -112,6 +112,7 @@ 'backreferences_dir': '../build/backrefs', 'expected_failing_examples': expected_failing_examples, 'subsection_order': subsection_order, + 'matplotlib_animations': True, } # The language for content autogenerated by Sphinx. Refer to documentation diff --git a/docs/source/whats_new.rst b/docs/source/whats_new.rst index ed0b8ce9d..b1aa8c475 100644 --- a/docs/source/whats_new.rst +++ b/docs/source/whats_new.rst @@ -1,3 +1,86 @@ +What's New in cartopy 0.19 +========================== + +:Release: 0.19.0 +:Date: 21st Apr 2021 + +For a full list of included Pull Requests and closed Issues, please see the +`0.19 milestone `_. + +Features +-------- + +* Thomas Grainger restored PEP-517 support to improve installations. + (:pull:`1681`) + +* @emsterr added the ability to style bounding boxes of labels. (:pull:`1669`) + +* Adrien Berchet added the ability to cache downloaded image tiles. + (:pull:`1533`) + +* Greg Lucas changed the vector interpolations to be strictly in the + source coordinates, which removed some erroneous extrapolations. + (:pull:`1636`) + +* Giacomo Caria added an option to remove the cardinal direction labels + from the axes. (:pull:`1662`) + +* Greg Lucas added the ability to update data within a pcolormesh plot + using `set_array()` to enable animations of the fields. (:pull:`1496`) + Liam Bindle extended this capability to update the color limits + (:pull:`1655`) and Sebastian David Eastham fixed the return values when + `get_array()` was called (:pull:`1656`) + +.. figure:: gallery/miscellanea/images/sphx_glr_animate_surface_001.gif + :target: gallery/miscellanea/animate_surface.html + :align: center + +* @htonchia and Greg Lucas fixed an issue with large cells appearing in + pcolormesh plots. (:pull:`1622`) + +* Philippe Miron added an example to demonstrate how to label specific + sides of the plot. (:pull:`1593`) + +* Greg Lucas added the option to restrict the limits of gridlines. (:pull:`1574`) + +* Kyle Penner fixed extrapolations using an alpha-channel in imshow(). + (:pull:`1582`) + +* Valentin Iovene added pkg-config instructions to help with installations on + MacOS. (:pull:`1596`) + +* Luke Davis updated the tight bbox calculations to include the gridliner labels. + (:pull:`1355`) + +* Luke Davis fixed the label padding for gridliners to use points which makes + the rendered screen image appear the same as the printed image now. + (:pull:`1556`) + +* Daryl Herzmann added the ability to make Hexbin plots. (:pull:`1542`) + + .. plot:: + :width: 400pt + + import matplotlib.pyplot as plt + import numpy as np + import cartopy.crs as ccrs + + fig = plt.figure(figsize=(10, 5)) + ax = plt.axes(projection=ccrs.Robinson()) + ax.coastlines() + + x, y = np.meshgrid(np.arange(-179, 181), np.arange(-90, 91)) + data = np.sqrt(x**2 + y**2) + ax.hexbin(x.flatten(), y.flatten(), C=data.flatten(), + gridsize=20, transform=ccrs.PlateCarree()) + plt.show() + +* Kyle Penner fixed image plotting when a 2D alpha array is input. (:pull:`1543`) + +* Elliott Sales de Andrade and Hugo van Kemenade removed Python 2 support. + (:pull:`1516`, :pull:`1517`, :pull:`1540`, :pull:`1544`, and :pull:`1547`) + + What's New in cartopy 0.18 ========================== diff --git a/examples/miscellanea/animate_surface.py b/examples/miscellanea/animate_surface.py new file mode 100644 index 000000000..a44a574fb --- /dev/null +++ b/examples/miscellanea/animate_surface.py @@ -0,0 +1,38 @@ +""" +Animating a gridded surface +--------------------------- + +This example demonstrates how to animate +gridded data using `pcolormesh()`. +""" +import matplotlib.pyplot as plt +from matplotlib.animation import FuncAnimation +import numpy as np +import cartopy.crs as ccrs + +fig = plt.figure(figsize=(10, 5)) +ax = plt.axes(projection=ccrs.Robinson()) +ax.set_global() +ax.coastlines() + +x = np.linspace(-80, 80) +xs, ys = np.meshgrid(2 * x + 180, x) +zs = xs + ys +vmin, vmax = np.min(zs), np.max(zs) +mesh = ax.pcolormesh(xs, ys, np.zeros_like(zs), transform=ccrs.PlateCarree(), + shading='auto', vmin=vmin, vmax=vmax) + +n = 10 + + +def update_mesh(t): + mesh.set_array(zs.ravel() * t) + + +ts = [i / n for i in range(n)] +# Go back to the start to make it a smooth repeat +ts += ts[::-1] +ani = FuncAnimation(fig, update_mesh, frames=ts, + interval=100) + +plt.show()