superjax / plotWindow

A tabbed plot window for matplotlib plots using PyQt5
23 stars 5 forks source link

Call use to register qt5agg as the backend #2

Closed jbwillis closed 4 years ago

jbwillis commented 4 years ago

This is a fix to issue #1. I am not quite sure why it works. Intuitively it makes sense that calling matplotlib.use('qt5agg') would perform some sort of registration. However, as I describe in this stackoverflow question, calling matplotlib.get_backend(), which simply returns a value from a dictionary works just as well.

To test, you can install a specific version of matplotlib using pip3 install matplotlib==3.1.2. Without this fix, running python3 plotWindow.py should fail. Incorporating the fix, python3 plotWindow.py should run as expected.

superjax commented 4 years ago

Nice Sleuthing! Yeah, that's bizzare... Sounds like it might have a fix coming down the line though, so that's good.

Could you add a comment about why? (potentially with a link to your stackoverflow question?)

I'm happy to merge this, thanks for looking into it.

jbwillis commented 4 years ago

Done. This is a useful tool to have on hand, so I am glad I found an easy fix!