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 suptitle #1663
Fix suptitle #1663
Conversation
@@ -65,6 +65,13 @@ def test_gca(): | |||
assert_true(fig.gca(projection='rectilinear') is ax1) | |||
assert_true(fig.gca() is ax1) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 compliance: you need two blank lines here.
I've underlined the two PEP8 problem. Else, the code looks good to me. |
Wooo! A legitimate test failure! @pelson Do you have any idea why that pickle test is failing? Looks like that title in the pickle baseline image is a suptitle, but the kwargs are still being set just as they were before this change. Perhaps the addition of a |
@dmcdougall - I'll have a butchers tomorrow at this for you. Has the result image gained a suptitle that wasn't there before? |
@pelson Another travis downside: I can't access the failing image. I'll run the test locally and report back. |
@pelson The produced image doesn't have a suptitle. Will look into it. |
I've found the issue. Since the There are a couple of ways to proceed:
I think 3) is overly harsh. I'd prefer to execute option 2), but if there is a consensus for 1), then I'm fine with that too. |
I am +1 on option 2. |
Ditto for option 2. |
Done. |
t = self.text(x, y, t, **kwargs) | ||
return t | ||
if self._suptitle is not None: | ||
self._suptitle.set_text('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should call the .remove()
method, rather than just making it a null Text object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps .update
, and put the line below inside an else:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way works. 😉
@pelson Better? |
Yep. 👍 from me. @NelleV - are you happy with it? |
LGTM: 👍 for merging |
Ok. I'll clean up the commit history and merge this (py31 failure is a dud). Thanks. |
(PR matplotlib#1505). Tests added is matplotlib#1663 pass with this patch.
New version of #1276 but which targets
v1.2.x
and includes a test.If there's no feedback I'll merge this in a day or two. I'd at least like @NelleV to check PEP8-ness, if you wouldn't mind :)