Skip to content
Snippets Groups Projects
Commit 398ed00c authored by Rob Moss's avatar Rob Moss
Browse files

Require matplotlib >= 3.4

Matplotlib has deprecated several subplot methods that were used in the
pypfilt.plot module. This commit updates pypfilt.plot to use the new
SubPlotSpec methods.
parent e3349459
No related branches found
No related tags found
No related merge requests found
Pipeline #17512 failed
......@@ -34,5 +34,5 @@ The packages required by pypfilt_ are:
* `h5py <http://www.h5py.org/>`__ 2.2 or newer;
* `tomli <https://github.com/hukkin/tomli>`__ 1.2 or newer;
* `tomli-w <https://github.com/hukkin/tomli-w>`__ 0.4 or newer; and
* `matplotlib <http://matplotlib.org/>`__ 1.5 or newer (optional, see
* `matplotlib <http://matplotlib.org/>`__ 3.4 or newer (optional, see
:ref:`api_plot`).
......@@ -36,7 +36,7 @@ install_requires =
tomli-w >= 0.4
[options.extras_require]
plot = matplotlib >= 1.5
plot = matplotlib >= 3.4
[options.packages.find]
where = src
......
......@@ -352,29 +352,30 @@ class Grid(Plot):
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
ax.label_outer()
if ax.is_first_col():
subplot = ax.get_subplotspec()
if subplot.is_first_col():
ax.set_ylabel(self.__ylbl)
if ax.is_last_col():
if subplot.is_last_col():
ax2 = ax.twinx()
ax2.set_ylabel(_label(self.__yfac[1], yf, 'yfac'),
rotation=270)
ax2.spines['right'].set_visible(False)
ax2.yaxis.set_ticks_position('none')
ax2.yaxis.set_ticklabels([])
if ax.is_last_row():
if subplot.is_last_row():
ax.set_xlabel(self.__xlbl)
if ax.is_first_row():
if subplot.is_first_row():
ax.set_title(_label(self.__xfac[1], xf, 'xfac'))
ax.xaxis.get_label().set_alpha(0)
ax.yaxis.get_label().set_alpha(0)
if hide_axes:
if not ax.is_first_col():
if not subplot.is_first_col():
ax.spines['left'].set_visible(False)
ax.yaxis.set_ticks_position('none')
if not ax.is_last_row():
if not subplot.is_last_row():
ax.spines['bottom'].set_visible(False)
ax.xaxis.set_ticks_position('none')
if ax.is_last_col():
if subplot.is_last_col():
ax2.spines['bottom'].set_visible(False)
ax2.spines['left'].set_visible(False)
yield ax, df
......
......@@ -23,9 +23,9 @@ test_paths = {envsitepackagesdir}/{[base]pkg} tests/ doc/
[testenv:test]
deps =
.[plot]
pytest
pytest-cov
matplotlib>=1.5
# NOTE: tox 3.18 deprecated whitelist_externals and added allowlist_externals.
whitelist_externals =
git
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment