Comments (2)
The error seems to be fixed if I explicitly declare
import matplotlib.pyplot as plt
at the start of the file and then use that to call it like this:plt.close('all')
. If that alone is satisfactory, I would request to do a PR.
This, or some variant of it, is the correct fix. Because matplotlib.pyplot
is not explicitly imported, it may or may not exist at the time of this call, depending on what previous code did. The simplest change would be:
if close and Gcf.get_all_fig_managers():
+ import matplotlib.pyplot
matplotlib.pyplot.close('all')
from matplotlib-inline.
@QuLogic That suggested fix won't work, as in the original example the matplotlib
module was overwritten silently by librosa, due to their implementation of lazy loading. See here for details.
In particular, as long as import matplotlib
is present first, adding import matplotlib.pyplot
won't work. However, it appears addingimport matplotlib.pyplot as plt
does work (for reasons that surpass my mortal understanding).
While I think such an import should be added (as per your fix), the issue is really upstream with librosa, so I've filed an issue there.
from matplotlib-inline.
Related Issues (17)
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte HOT 9
- docs for API calling HOT 1
- difference in plt.gca() behaviour between inline and notebook backends HOT 2
- Commit schedule for matplotlib-inline HOT 20
- [Bug]: Figure manager is gone - AttributeError: 'NoneType' object has no attribute 'canvas' HOT 6
- Switch from PNG to SVG output by default? HOT 4
- `plt.ioff()` not preventing automatic figure generation in jupyter
- Figures not automatically rendered in some cases
- Importing `backend_inline` triggers selection of `QtAgg` backend and tie-in of GUI event loop in IPython
- Add noop `show` method to manager
- `svg` and `png` outputs are different sizes
- Optional dependency on matplotlib? HOT 10
- Retina+jpeg option? HOT 3
- Question about pypi/matplotlib-inline pointing to a fork of this project. HOT 3
- figure formatters not in this package HOT 3
- Add from `. import backend_inline` in `__init__.py` ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matplotlib-inline.