|
1 | 1 | # This file generates the matplotlib web page logo
|
2 | 2 |
|
3 |
| -# from __future__ import print_function |
4 |
| -# Above import not necessary for Python 3 onwards. Recommend taking this out in all examples. |
| 3 | +# from __future__ import print_function |
| 4 | +# Above import not necessary for Python 3 onwards. Recommend taking this |
| 5 | +# out in all examples. |
5 | 6 | import matplotlib.pyplot as plt
|
6 |
| -import numpy as np |
| 7 | +import numpy as np |
7 | 8 | import matplotlib.cbook as cbook
|
8 | 9 |
|
9 | 10 | # convert data to mV
|
10 | 11 | datafile = cbook.get_sample_data('membrane.dat', asfileobj=False)
|
11 | 12 | print('loading', datafile)
|
12 | 13 |
|
13 |
| -x = 1000*0.1*np.fromstring(open(datafile, 'rb').read(), np.float32) |
| 14 | +x = 1000 * 0.1 * np.fromstring(open(datafile, 'rb').read(), np.float32) |
14 | 15 | # 0.0005 is the sample interval
|
15 |
| -t = 0.0005*np.arange(len(x)) |
| 16 | +t = 0.0005 * np.arange(len(x)) |
16 | 17 | plt.figure(1, figsize=(7, 1), dpi=100)
|
17 | 18 | ax = plt.subplot(111, axisbg='y')
|
18 | 19 | plt.plot(t, x)
|
19 | 20 | plt.text(0.5, 0.5, 'matplotlib', color='r',
|
20 |
| - fontsize=40, fontname=['Courier', 'Bitstream Vera Sans Mono'], |
21 |
| - horizontalalignment='center', |
22 |
| - verticalalignment='center', |
23 |
| - transform=ax.transAxes, |
24 |
| - ) |
| 21 | + fontsize=40, fontname=['Courier', 'Bitstream Vera Sans Mono'], |
| 22 | + horizontalalignment='center', |
| 23 | + verticalalignment='center', |
| 24 | + transform=ax.transAxes, |
| 25 | + ) |
25 | 26 | plt.axis([1, 1.72, -60, 10])
|
26 | 27 | plt.setp(plt.gca(), 'xticklabels', [])
|
27 | 28 | plt.setp(plt.gca(), 'yticklabels', [])
|
|
0 commit comments