Open gaowutong opened 2 years ago
Personally I would not use %pylab inline
as it pollutes the global namespace (see https://stackoverflow.com/a/24338062/6646912 for explanation), but we are not an authority on good code, so indeed we could make an exception and include the additional imports. PRs welcome.
Reference: https://ipython.readthedocs.io/en/stable/interactive/magics.html?highlight=pylab#magic-pylab
The ipython magic function
%pylab inline
automatically imports matplotlib. However, the lsp diagnostics reports the error "undefined name" when I try to use matplotlib. A similar result happens when using numpy. It only works well when the module is explicitly imported.