@@ -33,7 +33,7 @@ will be rendered as
33
33
for this document (see :ref: `ipython_literal `) because otherwise
34
34
you will see only the rendered output and not the code that
35
35
generated it. Excepting the example above, we will not in general
36
- be showing the literal ReST in this document that generates the
36
+ be showing the literal reST in this document that generates the
37
37
rendered output.
38
38
39
39
@@ -128,27 +128,24 @@ Another demonstration of multi-line input and output
128
128
...:
129
129
130
130
Most of the "pseudo-decorators" can be used as options to IPython
131
- mode. For example, to setup ``matplotlib `` / ``pylab `` but suppress the output,
132
- you can do. When using the matplotlib ``use `` directive, it should
133
- occur before any import of ``pylab ``. This will not show up in the
134
- rendered docs, but the commands will be executed in the embedded
135
- interpreter and subsequent line numbers will be incremented to reflect
136
- the inputs::
137
-
131
+ mode. For example, to setup ``matplotlib `` but suppress the output,
132
+ you can do. This will not show up in the rendered docs, but the commands
133
+ will be executed in the embedded interpreter and subsequent line numbers
134
+ will be incremented to reflect the inputs::
138
135
139
136
.. ipython::
140
137
:suppress:
141
138
142
- In [1]: from pylab import *
139
+ In [1]: import matplotlib.pyplot as plt
143
140
144
- In [2]: ion()
141
+ In [2]: plt. ion()
145
142
146
143
.. ipython ::
147
144
:suppress:
148
145
149
- In [1]: from pylab import *
146
+ In [1]: import matplotlib.pyplot as plt
150
147
151
- In [2]: ion()
148
+ In [2]: plt. ion()
152
149
153
150
Likewise, you can set the ``:doctest: `` or ``:verbatim: `` Sphinx options to
154
151
apply these settings to the entire block. For example,
@@ -190,23 +187,23 @@ You can create one or more plots and insert them with the
190
187
.. ipython ::
191
188
192
189
@savefig plot_simple.png width=4in
193
- In [1]: plot([1,2,3]);
190
+ In [1]: plt. plot([1,2,3]);
194
191
195
192
# use a semicolon to suppress the output
196
193
@savefig hist_simple.png width=4in
197
- In [2]: hist(np.random.randn(10000), 100);
194
+ In [2]: plt. hist(np.random.randn(10000), 100);
198
195
199
196
In a subsequent session, we can update the current figure with some
200
197
text, and then resave
201
198
202
199
.. ipython ::
203
200
204
- In [1]: ylabel('number')
201
+ In [1]: plt. ylabel('number')
205
202
206
- In [2]: title('normal distribution')
203
+ In [2]: plt. title('normal distribution')
207
204
208
205
@savefig hist_with_text.png width=4in align=center
209
- In [3]: grid(True)
206
+ In [3]: plt. grid(True)
210
207
211
208
Pseudo-Decorators
212
209
=================
0 commit comments