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

Improved fooling of IPython's hard-coded backend-to-gui mapping. #5

Merged
merged 1 commit into from
May 31, 2018

Conversation

anntzer
Copy link
Collaborator

@anntzer anntzer commented May 31, 2018

@afvincent I think this should fix the other half of #3 for you (basically ipython was essentially forcefully re-fetching the backend from your matplotlibrc (which uses qt5agg) rather than respecting MPLBACKEND (which should have priority)); can you confirm?
(IPython uses a hard-coded list of interactive backends to gui toolkits mappings and obviously mplcairo is not in there. So I just need to reverse-engineer the best way to fool it... In fact I just saw that I had noticed this specific issue a long time ago, ipython/ipython#10255.)
It's pure python so I'm not going to bother making a new wheel -- just patch mplcairo/base.py yourself :-)

@afvincent
Copy link

After replacing mplcairo/base.py with this version from this PR, the issue seems to be fixed indeed :):

In [1]: run example_issue_mplcairo.py
#0 module://mplcairo.qt
#1 module://mplcairo.qt
#2 module://mplcairo.qt
#3 module://mplcairo.qt

Thanks @anntzer !

@anntzer anntzer merged commit af7f250 into master May 31, 2018
@anntzer anntzer deleted the ipython-rcparamsorig branch May 31, 2018 18:16
anntzer added a commit that referenced this pull request Jul 20, 2018
IPython uses a hard-coded list of interactive backends to gui toolkits mappings and obviously mplcairo is not in there.  So I just need to reverse-engineer the best way to fool it...
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

2 participants