1- Introduction
2- ============
1+ History
2+ =======
3+
4+ .. note ::
5+
6+ The following introductory text was written in 2008 by John D. Hunter
7+ (1968-2012), the original author of Matplotlib.
38
49Matplotlib is a library for making 2D plots of arrays in `Python
510<https://www.python.org> `_. Although it has its origins in emulating
6- the MATLAB | reg | [ # ]_ graphics commands, it is
11+ the MATLAB graphics commands, it is
712independent of MATLAB, and can be used in a Pythonic, object oriented
813way. Although Matplotlib is written primarily in pure Python, it
914makes heavy use of `NumPy <http://www.numpy.org >`_ and other extension
1015code to provide good performance even for large arrays.
1116
12- .. |reg | unicode :: 0xAE
13- :ltrim:
14-
1517Matplotlib is designed with the philosophy that you should be able to
1618create simple plots with just a few commands, or just one! If you
1719want to see a histogram of your data, you shouldn't need to
@@ -62,10 +64,10 @@ The Matplotlib code is conceptually divided into three parts: the
6264*pylab interface * is the set of functions provided by
6365:mod: `matplotlib.pylab ` which allow the user to create plots with code
6466quite similar to MATLAB figure generating code
65- (:ref: ` sphx_glr_tutorials_introductory_pyplot.py `). The *Matplotlib frontend * or *Matplotlib
67+ (:doc: ` /tutorials/introductory/pyplot `). The *Matplotlib frontend * or *Matplotlib
6668API * is the set of classes that do the heavy lifting, creating and
6769managing figures, text, lines, plots and so on
68- (:ref: ` sphx_glr_tutorials_intermediate_artists.py `). This is an abstract interface that knows
70+ (:doc: ` /tutorials/intermediate/artists `). This is an abstract interface that knows
6971nothing about output. The *backends * are device-dependent drawing
7072devices, aka renderers, that transform the frontend representation to
7173hardcopy or a display device (:ref: `what-is-a-backend `). Example
@@ -87,8 +89,39 @@ people want to automatically generate PostScript files to send
8789to a printer or publishers. Others deploy Matplotlib on a web
8890application server to generate PNG output for inclusion in
8991dynamically-generated web pages. Some use Matplotlib interactively
90- from the Python shell in Tkinter on Windows™ . My primary use is to
92+ from the Python shell in Tkinter on Windows. My primary use is to
9193embed Matplotlib in a Gtk+ EEG application that runs on Windows, Linux
9294and Macintosh OS X.
9395
94- .. [# ] MATLAB is a registered trademark of The MathWorks, Inc.
96+ ----
97+
98+ Matplotlib's original logo (2003 -- 2008).
99+
100+ ..
101+ The original logo was added in fc8c215.
102+
103+ .. plot ::
104+
105+ from matplotlib import cbook, pyplot as plt, style
106+ import numpy as np
107+
108+ style.use("classic")
109+
110+ datafile = cbook.get_sample_data('membrane.dat', asfileobj=False)
111+
112+ # convert data to mV
113+ x = 1000 * 0.1 * np.fromstring(open(datafile, 'rb').read(), np.float32)
114+ # 0.0005 is the sample interval
115+ t = 0.0005 * np.arange(len(x))
116+ plt.figure(1, figsize=(7, 1), dpi=100)
117+ ax = plt.subplot(111, facecolor='y')
118+ plt.plot(t, x)
119+ plt.text(0.5, 0.5, 'matplotlib', color='r',
120+ fontsize=40, fontname=['Courier', 'DejaVu Sans Mono'],
121+ horizontalalignment='center',
122+ verticalalignment='center',
123+ transform=ax.transAxes,
124+ )
125+ plt.axis([1, 1.72, -60, 10])
126+ plt.gca().set_xticklabels([])
127+ plt.gca().set_yticklabels([])
0 commit comments