[yt-dev] Issue #809: Showing plots in the notebook broken for old versions of Ipython (yt_analysis/yt)
Andrew Myers
issues-reply at bitbucket.org
Sat Mar 22 18:31:59 PDT 2014
New issue 809: Showing plots in the notebook broken for old versions of Ipython
https://bitbucket.org/yt_analysis/yt/issue/809/showing-plots-in-the-notebook-broken-for
Andrew Myers:
I noticed this when I updated an old yt installation that had Ipython version 0.11. Creating, say, a SlicePlot in the notebook and then calling show() produces the following error:
```
#!python
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-4-bdbc9c77dc7a> in <module>()
----> 1 sl.show()
/Users/atmyers/yt/src/yt-hg/yt/visualization/plot_container.pyc in show(self)
452 api_version = get_ipython_api_version()
453 if api_version in ('0.10', '0.11'):
--> 454 self._send_zmq()
455 else:
456 from IPython.display import display
/Users/atmyers/yt/src/yt-hg/yt/visualization/plot_container.pyc in _send_zmq(self)
427 # Due to a quirk in the matplotlib API, we need to create
428 # a dummy canvas variable here that is never used.
--> 429 canvas = FigureCanvasAgg(v.figure) # NOQA
430 display(v.figure)
431
NameError: global name 'FigureCanvasAgg' is not defined
```
The fix is simply to add this import right before line 429. This likely eluded detection since this only affects users with rather old versions of Ipython...
PR incoming shortly.
Responsible: atmyers
More information about the yt-dev
mailing list