Show More
@@ -0,0 +1,16 b'' | |||||
|
1 | .. _kernel_install: | |||
|
2 | ||||
|
3 | Kernel Installation | |||
|
4 | ------------------- | |||
|
5 | ||||
|
6 | IPython can be installed (different python versions, virtualenv or conda environments) can | |||
|
7 | be installed as a kernel by following these steps: | |||
|
8 | ||||
|
9 | * make sure that the desired python installation is active (e.g. activate the environment) | |||
|
10 | and ipython is installed | |||
|
11 | * run once ``ipython kernelspec install-self --user`` (or ``ipython2 ...`` or ``ipython3 ...`` | |||
|
12 | if you want to install specific python versions) | |||
|
13 | ||||
|
14 | The last command installs a kernel spec file for the current python installation in | |||
|
15 | ``~/.jupyter/kernels/``. Kernel spec files are JSON files, which can be viewed and changed with a | |||
|
16 | normal text editor. |
@@ -0,0 +1,34 b'' | |||||
|
1 | .. _plotting: | |||
|
2 | ||||
|
3 | Plotting | |||
|
4 | -------- | |||
|
5 | One major feature of the Jupyter notebook is the ability to display plots that | |||
|
6 | are the output of running code cells. The IPython kernel is designed to work | |||
|
7 | seamlessly with the matplotlib_ plotting library to provide this functionality. | |||
|
8 | ||||
|
9 | To set this up, before any plotting is performed you must execute the | |||
|
10 | ``%matplotlib`` :ref:`magic command <magics_explained>`. This performs the | |||
|
11 | necessary behind-the-scenes setup for IPython to work correctly hand in hand | |||
|
12 | with ``matplotlib``; it does *not*, however, actually execute any Python | |||
|
13 | ``import`` commands, that is, no names are added to the namespace. | |||
|
14 | ||||
|
15 | If the ``%matplotlib`` magic is called without an argument, the | |||
|
16 | output of a plotting command is displayed using the default ``matplotlib`` | |||
|
17 | backend in a separate window. Alternatively, the backend can be explicitly | |||
|
18 | requested using, for example:: | |||
|
19 | ||||
|
20 | %matplotlib gtk | |||
|
21 | ||||
|
22 | A particularly interesting backend, provided by IPython, is the ``inline`` | |||
|
23 | backend. This is available only for the Jupyter Notebook and the | |||
|
24 | :ref:`IPython QtConsole <qtconsole>`. It can be invoked as follows:: | |||
|
25 | ||||
|
26 | %matplotlib inline | |||
|
27 | ||||
|
28 | With this backend, the output of plotting commands is displayed *inline* | |||
|
29 | within the notebook, directly below the code cell that produced it. The | |||
|
30 | resulting plots will then also be stored in the notebook document. | |||
|
31 | ||||
|
32 | .. seealso:: | |||
|
33 | ||||
|
34 | `Plotting with Matplotlib`_ example notebook |
General Comments 0
You need to be logged in to leave comments.
Login now