Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Toolbars keep history if axes change (navtoolbar2 + toolmanager) #4857
Conversation
tacaswell
added the
needs_review
label
Aug 3, 2015
KevKeating
referenced
this pull request
Aug 3, 2015
Closed
Toolbar tracks views if axes are added during use #3347
|
@KevKeating have you seen #4795 ? |
|
I hadn't seen it, but I just took a look through it and it looks quite nice. It shouldn't be difficult to merge this PR with that one. Calls to xmin, xmax, ymin, ymax = cur_lim
a.set_xlim((xmin, xmax))
a.set_ylim((ymin, ymax))in |
|
I just fixed a PEP8 issue in a docstring that Travis found. There was also a Python 2.6 failure that I'll look into soon. |
|
I think the python 2.6 failure was just a random Travis failure. I have restarted the test |
|
Just updated this PR to use the new API from #4795. |
tacaswell
added this to the
proposed next point release (2.1)
milestone
Oct 2, 2015
|
@tacaswell do you think it is pertinent just make the changes in toolmanager so no new features appear in the old ToolbarNavigation |
|
@fariza I think it is fine to only put this into toolmanager, but will defer final judgement to you on this. |
fariza
commented on the diff
Oct 13, 2015
| # Define Home | ||
| self.push_current() | ||
| - # Adding the clear method as axobserver, removes this burden from | ||
| - # the backend | ||
| - self.figure.add_axobserver(self.clear) |
fariza
Member
|
|
@KevKeating I really think it is better if we keep this confined to |
|
Just pushed an update. |
fariza
and 1 other
commented on an outdated diff
Oct 30, 2015
| # Define Home | ||
| self.push_current() | ||
| - # Adding the clear method as axobserver, removes this burden from | ||
| - # the backend | ||
| - self.figure.add_axobserver(self.clear) | ||
| - | ||
| - def clear(self, figure): |
fariza
Member
|
|
I'm not sure what's going on with the test failure. It looks like |
|
@KevKeating Do you think it is related to your changes? I don't see how. |
|
@fariza Me neither. I'm guessing that it's unrelated. |
fariza
added a commit
that referenced
this pull request
Jan 4, 2016
|
|
fariza |
c849398
|
KevKeating commentedAug 3, 2015
This is a fix for #2511. With this PR, the back, forward, and home buttons in the toolbar will continue to work even if the number of axes changes. I've implemented this fix in both the navtoolbar2 toolbar as well as the MEP22 toolmanager toolbar, so this PR essentially combines #3347 and fariza/matplotlib#5.
The PR adds a home_views dictionary that stores the initial views of all axes. If an axes object didn't exist when a view was created, then the initial view will be used for that axes in that view. Positions will only be restored if there is a position for all current axes objects. This avoids having newer axes overlap with older ones when clicking on back or home.
I've also removed toolbar.update() as an axobserver since it's no longer necessary. (I noticed that toolbar.update() was connected in all the backends except for Qt4, which explains the traceback I observed in #2511 when using Qt4.)