You are reading an old version of the documentation (v1.4.3). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

pylab_examples example code: log_test.py

Next topic

pylab_examples example code: major_minor_demo1.py

This Page

pylab_examples example code: logo.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/logo.png
#!/usr/bin/env python
# This file generates the matplotlib web page logo

from __future__ import print_function
from pylab import *
import matplotlib.cbook as cbook

# convert data to mV
datafile = cbook.get_sample_data('membrane.dat', asfileobj=False)
print('loading', datafile)

x = 1000*0.1*fromstring(file(datafile, 'rb').read(), float32)
# 0.0005 is the sample interval
t = 0.0005*arange(len(x))
figure(1, figsize=(7,1), dpi=100)
ax = subplot(111, axisbg='y')
plot(t, x)
text(0.5, 0.5,'matplotlib', color='r',
     fontsize=40, fontname='Courier',
     horizontalalignment='center',
     verticalalignment='center',
     transform = ax.transAxes,
     )
axis([1, 1.72,-60, 10])
setp(gca(), 'xticklabels', [])
setp(gca(), 'yticklabels', [])

show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)