Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Get proper renderer width and height in FigureImage #9204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed svg from tests and changed test names to match image names
  • Loading branch information
jklymak committed Sep 20, 2017
commit 90dcfe269e03ab21c8d100f44eec6ce192abd895
2 changes: 2 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,7 @@ def apply_aspect(self, position=None):
Use :meth:`_aspect` and :meth:`_adjustable` to modify the
axes box or the view limits.
"""
print('Apply Aspect')
if position is None:
position = self.get_position(original=True)

Expand Down Expand Up @@ -1406,6 +1407,7 @@ def apply_aspect(self, position=None):
pb = position.frozen()
pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect)
self.set_position(pb1.anchored(self.get_anchor(), pb), 'active')
print('self.gwet_positions', self.get_position(), self._position)
return

# reset active to original in case it had been changed
Expand Down
29 changes: 0 additions & 29 deletions lib/matplotlib/tests/baseline_images/test_image/figimage-0.svg

This file was deleted.

29 changes: 0 additions & 29 deletions lib/matplotlib/tests/baseline_images/test_image/figimage-1.svg

This file was deleted.

8 changes: 4 additions & 4 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def test_interp_nearest_vs_none():


@image_comparison(baseline_images=['figimage-0'],
extensions=['png','svg','pdf'])
def test_figimage():
extensions=['png','pdf'])
def test_figimage0():
'test the figimage method'

for suppressComposite in [False]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit concerned that we are losing testing the supressComposite=True code path.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, never mind, I should have read the next part of diff 🐑

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe I should clean this a bit. The for-loop worked when the test only did png, but never got to the second pdf for some reason. This (ahem) "fixed" the problem.

Expand All @@ -91,8 +91,8 @@ def test_figimage():
fig.figimage(img[::-1,::-1], xo=100, yo=100, origin='lower')

@image_comparison(baseline_images=['figimage-1'],
extensions=['png','svg','pdf'])
def test_figimage2():
extensions=['png','pdf'])
def test_figimage1():
'test the figimage method'

for suppressComposite in [True]:
Expand Down