Skip to content

Commit

Permalink
Merge branch 'glue-viz:main' into fix-frb-subsets-for-dask
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoster17 authored Sep 19, 2023
2 parents d9aeeb5 + 0712156 commit c576b50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions glue/utils/tests/test_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from matplotlib.artist import Artist
from numpy.testing import assert_allclose
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.backend_bases import ResizeEvent

from glue.tests.helpers import requires_scipy, requires_skimage
from glue.utils.misc import DeferredMethod
Expand Down Expand Up @@ -152,7 +153,8 @@ def test_freeze_margins():
# np.testing.assert_allclose(bbox.x1, 0.9)
# np.testing.assert_allclose(bbox.y1, 0.9)

fig.canvas.resize_event()
resize_event = ResizeEvent("resize_event", fig.canvas)
fig.canvas.callbacks.process(resize_event.name, resize_event)

bbox = ax.get_position()
np.testing.assert_allclose(bbox.x0, 0.25)
Expand All @@ -161,7 +163,8 @@ def test_freeze_margins():
np.testing.assert_allclose(bbox.y1, 0.75)

fig.set_size_inches(8, 8)
fig.canvas.resize_event()
resize_event = ResizeEvent("resize_event", fig.canvas)
fig.canvas.callbacks.process(resize_event.name, resize_event)

bbox = ax.get_position()
np.testing.assert_allclose(bbox.x0, 0.125)
Expand All @@ -170,7 +173,8 @@ def test_freeze_margins():
np.testing.assert_allclose(bbox.y1, 0.875)

ax.resizer.margins = [0, 1, 2, 4]
fig.canvas.resize_event()
resize_event = ResizeEvent("resize_event", fig.canvas)
fig.canvas.callbacks.process(resize_event.name, resize_event)

bbox = ax.get_position()
np.testing.assert_allclose(bbox.x0, 0.)
Expand Down

0 comments on commit c576b50

Please sign in to comment.