From 0187ded7223bbaded8022a28561182846b17ceb3 Mon Sep 17 00:00:00 2001 From: Douglas Burke Date: Tue, 13 Apr 2021 16:29:45 -0400 Subject: [PATCH 1/2] matlpotlib 3.4 has removed drawstyle from axes.errorbar The drawstyle argument has now been removed from some commands - this appears to just be the axes.errorbar function - in matplotlib version 3.4. --- sherpa/plot/pylab_backend.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Index: sherpa-4.13.0/sherpa/plot/pylab_backend.py =================================================================== --- sherpa-4.13.0.orig/sherpa/plot/pylab_backend.py +++ sherpa-4.13.0/sherpa/plot/pylab_backend.py @@ -1,6 +1,6 @@ # -# Copyright (C) 2010, 2015, 2017, 2019, 2020 -# Smithsonian Astrophysical Observatory +# Copyright (C) 2010, 2015, 2017, 2019, 2020, 2021 +# Smithsonian Astrophysical Observatory # # # This program is free software; you can redistribute it and/or modify @@ -316,7 +316,6 @@ def histo(xlo, xhi, y, yerr=None, title= color=color, alpha=alpha, linestyle='', - drawstyle=drawstyle, marker=marker, markersize=markersize, markerfacecolor=markerfacecolor, @@ -446,7 +445,6 @@ def plot(x, y, yerr=None, xerr=None, tit objs = axes.errorbar(x, y, yerr, xerr, color=color, linestyle=linestyle, - drawstyle=drawstyle, marker=marker, markersize=markersize, markerfacecolor=markerfacecolor, Index: sherpa-4.13.0/sherpa/astro/ui/tests/test_astro_ui_plot.py =================================================================== --- sherpa-4.13.0.orig/sherpa/astro/ui/tests/test_astro_ui_plot.py +++ sherpa-4.13.0/sherpa/astro/ui/tests/test_astro_ui_plot.py @@ -1,5 +1,6 @@ # -# Copyright (C) 2019, 2020 Smithsonian Astrophysical Observatory +# Copyright (C) 2019, 2020, 2021 +# Smithsonian Astrophysical Observatory # # # This program is free software; you can redistribute it and/or modify @@ -1168,7 +1169,8 @@ def test_img_contour_function_kwarg(clea for i, ax in enumerate(axes, 1): - assert ax.get_geometry() == (2, 2, i) + w = i - 1 + assert ax.get_subplotspec().get_geometry() == (2, 2, w, w) assert ax.get_xscale() == 'linear' assert ax.get_yscale() == 'linear' Index: sherpa-4.13.0/sherpa/ui/tests/test_ui_plot.py =================================================================== --- sherpa-4.13.0.orig/sherpa/ui/tests/test_ui_plot.py +++ sherpa-4.13.0/sherpa/ui/tests/test_ui_plot.py @@ -1,5 +1,6 @@ # -# Copyright (C) 2019, 2020 Smithsonian Astrophysical Observatory +# Copyright (C) 2019, 2020, 2021 +# Smithsonian Astrophysical Observatory # # # This program is free software; you can redistribute it and/or modify @@ -1113,7 +1114,7 @@ def test_plot_single(session): ax = fig.axes[0] - assert ax.get_geometry() == (1, 1, 1) + assert ax.get_subplotspec().get_geometry() == (1, 1, 0, 0) assert ax.get_title() == '' assert ax.xaxis.get_label().get_text() == 'x' assert ax.yaxis.get_label().get_text() == 'y' @@ -1127,7 +1128,7 @@ def test_plot_single(session): ax = fig.axes[0] - assert ax.get_geometry() == (1, 1, 1) + assert ax.get_subplotspec().get_geometry() == (1, 1, 0, 0) assert ax.get_title() == 'Model' assert ax.xaxis.get_label().get_text() == 'x' assert ax.yaxis.get_label().get_text() == 'y' @@ -1179,7 +1180,8 @@ def test_plot_multiple(session): 'Data / Model']), 1): - assert ax.get_geometry() == (2, 3, i) + w = i - 1 + assert ax.get_subplotspec().get_geometry() == (2, 3, w, w) assert ax.get_title() == title assert ax.xaxis.get_label().get_text() == 'x' assert ax.yaxis.get_label().get_text() == ylabel @@ -1226,7 +1228,7 @@ def test_contour_single(session): ax = fig.axes[0] - assert ax.get_geometry() == (1, 1, 1) + assert ax.get_subplotspec().get_geometry() == (1, 1, 0, 0) assert ax.get_title() == '' assert ax.xaxis.get_label().get_text() == 'x0' assert ax.yaxis.get_label().get_text() == 'x1' @@ -1240,7 +1242,7 @@ def test_contour_single(session): ax = fig.axes[0] - assert ax.get_geometry() == (1, 1, 1) + assert ax.get_subplotspec().get_geometry() == (1, 1, 0, 0) assert ax.get_title() == 'Model' assert ax.xaxis.get_label().get_text() == 'x0' assert ax.yaxis.get_label().get_text() == 'x1' @@ -1287,7 +1289,8 @@ def test_contour_multiple(session): 'Ratio of Data to Model']), 1): - assert ax.get_geometry() == (2, 3, i) + w = i - 1 + assert ax.get_subplotspec().get_geometry() == (2, 3, w, w) assert ax.get_title() == title assert ax.xaxis.get_label().get_text() == 'x0' assert ax.yaxis.get_label().get_text() == 'x1' @@ -1343,7 +1346,8 @@ def test_contour_xxx(plotfunc, title, pc ['', 'Residuals']), 1): - assert ax.get_geometry() == (2, 1, i) + w = i - 1 + assert ax.get_subplotspec().get_geometry() == (2, 1, w, w) assert ax.get_title() == title assert ax.xaxis.get_label().get_text() == 'x0' assert ax.yaxis.get_label().get_text() == 'x1' @@ -1352,7 +1356,7 @@ def test_contour_xxx(plotfunc, title, pc assert len(fig.axes) == 1 ax = fig.axes[0] - assert ax.get_geometry() == (1, 1, 1) + assert ax.get_subplotspec().get_geometry() == (1, 1, 0, 0) assert ax.get_title() == title assert ax.xaxis.get_label().get_text() == 'x0' assert ax.yaxis.get_label().get_text() == 'x1'