Show More
@@ -82,20 +82,7 b' class PylabMagics(Magics):' | |||
|
82 | 82 | '--no-import-all', action='store_true', default=None, |
|
83 | 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:: | |
|
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 | |
|
85 | You can govern the default behavior of this flag with the | |
|
99 | 86 | InteractiveShellApp.pylab_import_all configurable. |
|
100 | 87 | """ |
|
101 | 88 | ) |
@@ -106,10 +93,24 b' class PylabMagics(Magics):' | |||
|
106 | 93 | This function lets you activate pylab (matplotlib, numpy and |
|
107 | 94 | interactive support) at any point during an IPython session. |
|
108 | 95 | |
|
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. | |
|
96 | %pylab makes the following imports:: | |
|
111 | 97 | |
|
112 | See the %matplotlib magic for more details. | |
|
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 | 115 | args = magic_arguments.parse_argstring(self.pylab, line) |
|
115 | 116 | if args.no_import_all is None: |
General Comments 0
You need to be logged in to leave comments.
Login now