-
Removed support for python 3.9 (#130).
-
The minimum versions of some dependencies were changed (#132).
Package Old New cartopy 0.21 0.22 matplotlib 3.6 3.8 numpy 1.22 1.24 seaborn 0.12 0.13 xarray 2022.12 2023.9 -
The modules
cartopy_utils
,colormaps
,map_layout
,mpl
, andxrcompat
were renamed (added a leading underscore) to indicate that they are private (#141 and #142).
-
Added convenience functions to draw hatches and add stippling:
mpu.hatch
: for regular axesmpu.hatch_map
: for cartopy GeoAxesmpu.hatch_map_global
: as 2. but also adds a cyclic point to the array
all three functions expect a 2D boolean
xr.DataArray
and a hatch pattern. Values that areTrue
are hatched (#123 and #143). -
Enable passing
AxesGrid
(frommpl_toolkits.axes_grid1
) toset_map_layout
(#116). -
Raise more informative error when a wrong type is passed to
set_map_layout
(#121). -
set_map_layout
now raises an explicit error when the figure contains SubFigure (#121). -
Test upstream dependencies and fix compatibility with the upcoming pandas v3 (#133).
- Ensure the current axes (
plt.gca()
) is not changed by callingmpu.colorbar(...)
(#136).
- Align internal usage of
ListedColormaps
with changes in matplotlib/matplotlib#29135 (#145, and #147).
Version v0.5.0 aligns passing multiple axes to colorbar
with matplotlib.
-
The
ax1
andax2
arguments ofmpu.colorbar
have been combined intoax
(#107) To update- mpu.colorbar(h, axs[0], axs[1]) + mpu.colorbar(h, [axs[0], axs[1]])
or
- mpu.colorbar(h, axs[0], axs[1]) + mpu.colorbar(h, axs)
-
When passing
size
tompu.colorbar
it now uses the height/ width of all passed axes to scale the colorbar. This is consistent withplt.colorbar
but may lead to differences compared to the previous version (#107). -
Similarly for
pad
, which is also scaled by the height/ width of all passed axes. This is consistent withplt.colorbar
but may change the padding of the colorbar compared to the previous version (#107).
Version 0.4.0 simplifies the way figures with a mpu.colorbar
have to be saved and
bumps the supported versions.
-
Removed support for python 3.7 and python 3.8 (#88).
-
The minimum versions of some dependencies were changed (#88, #91, and #96).
Package Old New cartopy 0.18 0.21 matplotlib* 3.4 3.6 numpy 1.17 1.22 seaborn 0.11 0.12 xarray 0.15 2022.12 -
sample_data_map
now offsets the lon data such that the first grid cell does not wrap around (#87).
- Calling
f.canvas.draw()
beforeplt.savefig
is no longer necessary. This now happens automatically (#98). - Add python 3.12 to list of supported versions (#89).
Version v0.3.1 fixes a regression and an additional bug from v0.3.0. It's recommended to use this version.
- Fixed a bug in
set_map_layout
: the data ratio of a cartopyGeoAxesSubplot
requires adraw
to be correct (#61). - Fix a regression introduced in #33:
cyclic_dataarray
now correctly extrapolates the coordinates (#58).
Version 0.3.0 includes some long-overdue bug fixes, modernization of the code, much better test coverage and some enhancements.
mplotutils now uses the MIT license instead of GPL-3.0 (#51)
- Deprecated
mpu.infer_interval_breaks
as this is no longer necessary with matplotlib v3.2 and cartopy v0.21 (#32). - Deprecated a number of positional arguments, these are now keyword only, e.g. in
mpu.colorbar
(#54).
- Added
nrow
andncol
parameters toset_map_layout
for use with a gridspec. - Allow passing list of axes to
set_map_layout
, renamed the files and extended the test coverage (#42 and #43). - Add function to create
xr.DataArray
sample data (#53).
- Fixed compatibility of
mpu.colorbar
withbbox_inches="tight"
for matplotlib 3.4 and newer and refactor and extend tests (#26 and #40).
- Replaced
ax.get_geometry()
withax.get_subplotspec().get_geometry()
as the former was deprecated in matplotlib (#8). - Refactor
mpu.cyclic_dataarray
usingobj.pad
(#33). - Enabled CI on github actions (#9).
- Formatted with black and isort, checked with flake8.
Mayor release, mostly introducing the new colorbar
functionality.
- add
_color_palette
that selects colors from the whole range of the colormap. Previously we used theseaborn
logic that excludes colors at the edge of the colorbar (#1). - the colorbar functionality was entirely redesigned:
- new top-level function
mpu.colorbar
- added
aspect
keyword which defines the ratio of long to short side - the default width/ height is now
aspect=20
(wassize=0.04
) pad
andsize
are now scaled by the width/ height of the axes (was width/ height of the figure)pad
now uses the matplotlib default (0.05 for vertical bars and 0.15 for horizontal colorbars)
- new top-level function
- add
_is_monotonic
toinfer_interval_breaks
- renamed
sample_data_3d
tosample_data_map
- Functionality as developed for pyvis (see below), packed into a module.