@@ -10,36 +10,28 @@ Image tutorial
10
10
Startup commands
11
11
===================
12
12
13
- At the very least, you'll need to have access to the
14
- :func: `~matplotlib.pyplot.imshow ` function. There are a couple of
15
- ways to do it. The easy way for an interactive environment::
16
-
13
+ In this tutorial we will work interactively with images. To do so we will use
14
+ the IPython shell. You can start it with::
15
+
17
16
$ipython
18
17
19
- to enter the ipython shell, followed by::
20
-
21
- In [1]: %pylab
22
-
23
- to enter the pylab environment.
24
-
25
- The imshow function is now directly accessible (it's in your
26
- `namespace <http://bytebaker.com/2008/07/30/python-namespaces/ >`_).
27
- See also :ref: `pyplot-tutorial `.
28
-
29
- The more expressive, easier to understand later method (use this in
30
- your scripts to make it easier for others (including your future self)
31
- to read) is to use the matplotlib API (see :ref: `artist-tutorial `)
32
- where you use explicit namespaces and control object creation, etc...
18
+ At the very least, you'll need to have access to the
19
+ :func: `~matplotlib.pyplot.imshow ` function. The easy way for an interactive
20
+ environment: is to use the matplotlib API (see :ref: `artist-tutorial `) where
21
+ you use explicit
22
+ `namespaces <http://bytebaker.com/2008/07/30/python-namespaces/ >`_ and control
23
+ object creation, etc...::
33
24
34
25
.. sourcecode :: ipython
35
26
36
27
In [1]: import matplotlib.pyplot as plt
37
28
In [2]: import matplotlib.image as mpimg
38
29
In [3]: import numpy as np
39
30
40
- Examples below will use the latter method, for clarity. In these
41
- examples, if you use the %pylab method, you can skip the "mpimg." and
42
- "plt." prefixes.
31
+ You can now access functions like :func: `~matplotlib.pyplot.imshow ` by using:
32
+ `plt.imshow(yourimage) `. You can learn more about these functions in the
33
+ :ref: `pyplot-tutorial `.
34
+
43
35
44
36
.. _importing_data :
45
37
0 commit comments