Skip to content

Adapt inline backend to changes in matplotlib #2384

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

Closed
wants to merge 2 commits into from

Conversation

jenshnielsen
Copy link
Contributor

Matplotlib recently merged matplotlib/matplotlib#1125 that makes it simpler to use
objective oriented figure creation by automatically creating the right canvas for the backend. To solve that
all backends must provide a backend_xxx.FigureCanvas. This is obviosly missing from the inline backend.

The change is needed to make the inline backend work with mpl's 1.2.x branch which is due to released soon. Simply setting the default canvas equal to a Agg canvas appears to work for both svg and png figures but I'm not sure weather that is the right approach. Should the canvas depend on the figure format and provide a svg canvas for a svg figure? (Note that before this change to matplotlib the canvas from a plt.figure call seams to be a agg type in all cases)

Edit: I made the pull request against 0.13.1 since it would be good to have this in the stable branch for when mpl is released.
Just let me know and I can rebase it against master

@travisbot
Copy link

This pull request passes (merged f152a1a into e567806).

@takluyver
Copy link
Member

Thanks for getting onto this so quickly. I'd be inclined to add a comment just above the FigureCanvas = line describing what it's there for, so we don't later think it's an unused variable.

@jenshnielsen
Copy link
Contributor Author

@takluyver Good point. Comment added

@takluyver
Copy link
Member

Thanks. If my matplotlib PPA build succeeds tonight, I'll test this tomorrow. Otherwise, I'll take your word for it that it works.

@minrk
Copy link
Member

minrk commented Sep 5, 2012

Please do make this a PR against master. We backport PRs to 0.13.1 from master by tagging the appropriate ones.

minrk added a commit that referenced this pull request Oct 11, 2012
Matplotlib recently merged matplotlib/matplotlib#1125 that makes it simpler to use
objective oriented figure creation by automatically creating the right canvas for the backend. To solve that
all backends must provide a backend_xxx.FigureCanvas. This is obviosly missing from the inline backend.

The change is needed to make the inline backend work with mpl's 1.2.x branch which is due to released soon. Simply setting the default canvas equal to a Agg canvas appears to work for both svg and png figures but I'm not sure weather that  is the right approach. Should the canvas depend on the figure format and provide a svg canvas for a svg figure? (Note that before this change to matplotlib the canvas from a plt.figure call seams to be a agg type in all cases)

Edit: I made the pull request against 0.13.1 since it would be good to have this in the stable branch for when mpl is released.
Just let me know and I can rebase it against master
mindw pushed a commit to mindw/ipython that referenced this pull request Oct 18, 2012
Matplotlib recently merged matplotlib/matplotlib#1125 that makes it simpler to use
objective oriented figure creation by automatically creating the right canvas for the backend. To solve that
all backends must provide a backend_xxx.FigureCanvas. This is obviosly missing from the inline backend.

The change is needed to make the inline backend work with mpl's 1.2.x branch which is due to released soon. Simply setting the default canvas equal to a Agg canvas appears to work for both svg and png figures but I'm not sure weather that  is the right approach. Should the canvas depend on the figure format and provide a svg canvas for a svg figure? (Note that before this change to matplotlib the canvas from a plt.figure call seams to be a agg type in all cases)

Edit: I made the pull request against 0.13.1 since it would be good to have this in the stable branch for when mpl is released.
Just let me know and I can rebase it against master
yarikoptic added a commit to yarikoptic/ipython that referenced this pull request May 2, 2014
* tag 'rel-0.13.1': (27 commits)
  remove rc for 0.13.1 final
  0.13.1.rc3
  qtconsole extras_require to whatsnew
  Backport PR ipython#2492: add missing 'qtconsole' extras_require
  add 2480 to whatsnew
  Backport PR ipython#2480: Add deprecation warnings for sympyprinting
  PR 2384 to whatsnew
  mark 0.13.1.rc2
  Backport PR ipython#2384: Adapt inline backend to changes in matplotlib
  mark 0.13.1.rc1
  update 0.13.1 whatsnew lists
  Backport PR ipython#2479: use new _winapi instead of removed _subprocess
  Backport PR ipython#2437: don't let log cleanup prevent engine start
  Backport PR ipython#2405: clarify TaskScheduler.hwm doc
  Backport PR ipython#2377: Fix installation of man pages in Python 3
  start 0.13.1 whatsnew
  Backport PR ipython#2373: fix missing imports in core.interactiveshell
  Backport PR ipython#2365: fix names of notebooks for download/save
  Backport PR ipython#2345: Remove references to 'version' no longer in argparse. Github issue ipython#2343.
  Backport PR ipython#2347: adjust division error message checking to account for Python 3
  ...
yarikoptic added a commit to yarikoptic/ipython that referenced this pull request May 2, 2014
* tag 'rel-0.13.1': (51 commits)
  remove rc for 0.13.1 final
  0.13.1.rc3
  qtconsole extras_require to whatsnew
  Backport PR ipython#2492: add missing 'qtconsole' extras_require
  add 2480 to whatsnew
  Backport PR ipython#2480: Add deprecation warnings for sympyprinting
  PR 2384 to whatsnew
  mark 0.13.1.rc2
  Backport PR ipython#2384: Adapt inline backend to changes in matplotlib
  mark 0.13.1.rc1
  update 0.13.1 whatsnew lists
  Backport PR ipython#2479: use new _winapi instead of removed _subprocess
  Backport PR ipython#2437: don't let log cleanup prevent engine start
  Backport PR ipython#2405: clarify TaskScheduler.hwm doc
  Backport PR ipython#2377: Fix installation of man pages in Python 3
  start 0.13.1 whatsnew
  Backport PR ipython#2373: fix missing imports in core.interactiveshell
  Backport PR ipython#2365: fix names of notebooks for download/save
  Backport PR ipython#2345: Remove references to 'version' no longer in argparse. Github issue ipython#2343.
  Backport PR ipython#2347: adjust division error message checking to account for Python 3
  ...
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.

4 participants