8000 Fix FancyBboxPatch Typo by jakevdp · Pull Request #2701 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix FancyBboxPatch Typo #2701

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 2 commits into from
Jan 5, 2014
Merged
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
Next Next commit
Fix FancyBboxPatch Typo
  • Loading branch information
jakevdp committed Jan 1, 2014
commit ef0d27a1c3e831e5f338c591d77909722a1859f5
5 changes: 2 additions & 3 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -2236,9 +2236,8 @@ class FancyBboxPatch(Patch):
"""

def __str__(self):
return self.__class__.__name__ \
+ "FancyBboxPatch(%g,%g;%gx%g)" % (self._x, self._y,
self._width, self._height)
return "FancyBboxPatch(%g,%g;%gx%g)" % (self._x, self._y,
Copy link
Member

Choose a reason for hiding this comment

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

There are two possible ways of fixing this bug: the way you did it, or by keeping the self.__class__.__name__ and deleting the "FancyBboxPatch" part of the following string. The advantage of the second way is that it gives the correct result for subclasses of FancyBboxPatch.

Copy link
Member

Choose a reason for hiding this comment

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

I think the second way of fixing this is the better choice (and the places where the class name is hard-coded in should be changed opportunistically).

self._width, self._height)

@docstring.dedent_interpd
def __init__(self, xy, width, height,
Expand Down
0