ipython's Chinese description of %pylab

高洛峰
Release: 2017-03-15 13:49:16
Original
3158 people have browsed it

Format: %pylab [--no-import-all] [gui]

This command will be executed in ipython or notebook environment Automatically load the numpy and matplotlib libraries, which have the same function as the following statements

import numpy

import matplotlib

from matplotlib import pylab, mlab, pyplot

np = numpy

plt = pyplot


## from IPython.

display import display

from IPython.core .pylabtools import figsize, getfigs


from pylab import *

from numpy import *

if --no-import-all is passed option, the last two statements above will not be executed

Optional gui parameters

Specify the backend available for matplotlib. The available parameters are, 'agg', 'gtk', 'gtk3 ', 'inline', 'ipympl', 'nbagg', 'notebook', 'osx', 'qt', 'qt4', 'qt5', 'tk', 'wx', if this parameter is set, it will Use the corresponding backend, otherwise use the default backend. Of course, you can also modify the default parameters in matplotlib's

configuration file.


In these Among the parameters, only the inline parameter will draw the chart directly on qtconsole or notebook, and the others will draw the chart in the new pop-up dialog box.


The above is the detailed content of ipython's Chinese description of %pylab. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template