Show More
@@ -82,20 +82,7 b' class PylabMagics(Magics):' | |||||
82 | '--no-import-all', action='store_true', default=None, |
|
82 | '--no-import-all', action='store_true', default=None, | |
83 | help="""Prevent IPython from performing ``import *`` into the interactive namespace. |
|
83 | help="""Prevent IPython from performing ``import *`` into the interactive namespace. | |
84 |
|
84 | |||
85 | The names that will still be added to the namespace if this flag is given:: |
|
85 | You can govern the default behavior of this flag with the | |
86 |
|
||||
87 | numpy |
|
|||
88 | matplotlib |
|
|||
89 | np (numpy alias) |
|
|||
90 | plt (matplotlib.pyplot alias) |
|
|||
91 | pylab (from matplotlib) |
|
|||
92 | pyplot (from matplotlib) |
|
|||
93 | mlab (from matplotlib) |
|
|||
94 | display (from IPython) |
|
|||
95 | figsize (from IPython) |
|
|||
96 | getfigs (from IPython) |
|
|||
97 |
|
||||
98 | You can govern the default behavior with the |
|
|||
99 | InteractiveShellApp.pylab_import_all configurable. |
|
86 | InteractiveShellApp.pylab_import_all configurable. | |
100 | """ |
|
87 | """ | |
101 | ) |
|
88 | ) | |
@@ -105,11 +92,25 b' class PylabMagics(Magics):' | |||||
105 |
|
92 | |||
106 | This function lets you activate pylab (matplotlib, numpy and |
|
93 | This function lets you activate pylab (matplotlib, numpy and | |
107 | interactive support) at any point during an IPython session. |
|
94 | interactive support) at any point during an IPython session. | |
108 |
|
||||
109 | It will import at the top level numpy as np, pyplot as plt, matplotlib, |
|
|||
110 | pylab and mlab, as well as all names from numpy and pylab. |
|
|||
111 |
|
95 | |||
112 | See the %matplotlib magic for more details. |
|
96 | %pylab makes the following imports:: | |
|
97 | ||||
|
98 | import numpy | |||
|
99 | import matplotlib | |||
|
100 | from matplotlib import pylab, mlab, pyplot | |||
|
101 | np = numpy | |||
|
102 | plt = pyplot | |||
|
103 | ||||
|
104 | from IPython.display import display | |||
|
105 | from IPython.core.pylabtools import figsize, getfigs | |||
|
106 | ||||
|
107 | from pylab import * | |||
|
108 | from numpy import * | |||
|
109 | ||||
|
110 | If you pass `--no-import-all`, the last two `*` imports will be excluded. | |||
|
111 | ||||
|
112 | See the %matplotlib magic for more details about activating matplotlib | |||
|
113 | without affecting the interactive namespace. | |||
113 | """ |
|
114 | """ | |
114 | args = magic_arguments.parse_argstring(self.pylab, line) |
|
115 | args = magic_arguments.parse_argstring(self.pylab, line) | |
115 | if args.no_import_all is None: |
|
116 | if args.no_import_all is None: |
General Comments 0
You need to be logged in to leave comments.
Login now