0

I've tried running the code from this answer, and get the following (after pressing 'Plot':

enter image description here

Here's what I find unexpected: if I press the 'pan axes' button in the navigation bar (highlighted in blue in the above screenshot), move the figure slightly to the right, and then press the 'home button' in the navigation bar, then nothing happens.

However, if then move the figure again and then press the 'home button' again, then it returns me to the position I got to after I moved the figure once.

How can I set the navigation bar up so that the 'home' button returns me to the original plot every time?

ignoring_gravity
  • 6,677
  • 4
  • 32
  • 65
  • 1
    I don't have this behavior on my computer. The code in the link works perfectly. – ymmx May 14 '18 at 13:40
  • @ymmx how exactly are you running the code? I have just saved it as 'my_test.py', navigated to that folder in the Anaconda prompt, and have typed in 'python my_test.py'. – ignoring_gravity May 14 '18 at 13:46
  • 1
    that's what i did. did you check that your matplotlib is up to date? also the pyqt module? – ymmx May 14 '18 at 16:34
  • There has been some bug in the way the home-state was defined, but that should be fixed in matplotlib 2.2.2. I would suggest to update to the newest version and see if the undesired behaviour is still there. If it is, you should file a bug report; but I'm pretty sure this is fixed by now. – ImportanceOfBeingErnest May 14 '18 at 20:28
  • I was using matplotlib 2.1.0. I just updated it to 2.2.2, and it works. Thank you! – ignoring_gravity May 15 '18 at 09:51

0 Answers0