next up previous contents index
Next: Plotting a function of a single variable Up: Getting Started with plt Previous: Using color

Plotting an image

The plt package includes a tiny program named imageplt that can be used together with plt to plot a greyscale image, as shown in figure 2.8. The input to imageplt should be a list of grey levels (0 = black, 1 = white) for each pixel in the image, beginning at the lower left corner, going up each column, then continuing from the bottom of the next column, etc. For example, suppose the input file image.data contains:

1 .9 .8 .7 .6
0 0 0 0 0
1 1 1 1 1

These data can be plotted as a 3x5 image to produce figure 2.8. For further details, see Appendix H.

Figure 2.8: Produced using the command:
\begin{figure}\begin{center}
\fcolorbox{blue}{white}{
\epsfig{file=image,height=...
...d 5 3 image.data \vert plt 0 1 2 -pc\end{boxedverbatim}
\end{center}\end{figure}



George B. Moody (george@mit.edu)
2005-04-26