--The beginning of the line %
is a magic function (function of ʻipython) --How to find out is
% magic in the interactive mode of ʻipython
--If you look up % matplotlib
,% matplotlib?
I'm probably studying at jupyter
, but it's salty.
jupyter
In1: %matplotlib inline
In2: import matplotlib.pyplot as plt
What is the %
at the beginning of the line?
I don't know what it means. For the time being, practice RYFM
.
python
$ pydoc matplotlib
(Omitted)
or using ipython::
ipython
at your terminal, followed by::
In [1]: %matplotlib
In [2]: import matplotlib.pyplot as plt
at the ipython shell prompt.
(Omitted)
Even if you get %
, you might think that it is a function of the main body of Python
.
The result of google. ↓
%quickref
At the command line, do ʻipython and
% quickref`.
python
$ ipython
In [1]: %quickref
(Omitted)
%magic : Information about IPython's 'magic' % functions.
(Omitted)
Then the explanation of magic
is% magic
.
%magic
python
In [2]: %magic
IPython's 'magic' functions
===========================
The magic function system provides a series of functions which allow you to
control the behavior of IPython itself, plus a lot of system-type
features. There are two kinds of magics, line-oriented and cell-oriented.
(Omitted)
So, if you search for matplotlib
, the explanation will come out.
Apart from that
For a list of the available magic functions, use %lsmagic. For a description of any of them, type %magic_name?, e.g. '%cd?'.
That's right
%matplotlib?
python
$ ipython
In [1]: %matplotlib?
To do.
Recommended Posts