Skip to content
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

Fix FancyBboxPatch Typo #2701

Merged
merged 2 commits into from Jan 5, 2014
Merged

Conversation

jakevdp
Copy link
Contributor

@jakevdp jakevdp commented Jan 1, 2014

A tiny cosmetic fix. Previous behavior was

>>> from matplotlib.patches import FancyBboxPatch
>>> print FancyBboxPatch((0, 0), 1, 1)
FancyBboxPatchFancyBboxPatch(0,0;1x1)

After this PR it is

>>> print FancyBboxPatch((0, 0), 1, 1)
FancyBboxPatch(0,0;1x1)

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).

@jakevdp
Copy link
Contributor Author

jakevdp commented Jan 1, 2014

OK. I noticed that both strategies are used in different classes throughout the file - I chose one of them arbitrarily.

@jakevdp
Copy link
Contributor Author

jakevdp commented Jan 4, 2014

I think this is ready

@tacaswell
Copy link
Member

@efiring This should probably be cherry picked to 1.3.x as well.

tacaswell added a commit that referenced this pull request Jan 5, 2014
@tacaswell tacaswell merged commit 93cce5e into matplotlib:master Jan 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants