|
1 |
| -#!/usr/bin/env python |
2 | 1 | """
|
3 | 2 | make the matplotlib svg minimization icon
|
4 | 3 | """
|
| 4 | +import matplotlib.pyplot as plt |
5 | 5 | import matplotlib
|
6 |
| -#matplotlib.use('Svg') |
7 |
| -from pylab import * |
| 6 | +import numpy as np |
8 | 7 |
|
9 |
| -rc('grid', ls='-', lw=2, color='k') |
10 |
| -fig = figure(figsize=(1, 1), dpi=72) |
11 |
| -axes([0.025, 0.025, 0.95, 0.95], axisbg='#bfd1d4') |
| 8 | +matplotlib.rc('grid', ls='-', lw=2, color='k') |
| 9 | +fig = plt.figure(figsize=(1, 1), dpi=72) |
| 10 | +plt.axes([0.025, 0.025, 0.95, 0.95], axisbg='#bfd1d4') |
12 | 11 |
|
13 |
| -t = arange(0, 2, 0.05) |
14 |
| -s = sin(2*pi*t) |
15 |
| -plot(t, s, linewidth=4, color="#ca7900") |
16 |
| -axis([-.2, 2.2, -1.2, 1.2]) |
| 12 | +t = np.arange(0, 2, 0.05) |
| 13 | +s = np.sin(2*np.pi*t) |
| 14 | +plt.plot(t, s, linewidth=4, color="#ca7900") |
| 15 | +plt.axis([-.2, 2.2, -1.2, 1.2]) |
17 | 16 |
|
18 |
| -# grid(True) |
19 |
| -setp(gca(), xticklabels=[], yticklabels=[]) |
20 |
| -savefig('matplotlib', facecolor='0.75') |
| 17 | +ax = plt.gca() |
| 18 | +ax.set_xticklabels([]) |
| 19 | +ax.set_yticklabels([]) |
| 20 | + |
| 21 | +plt.show() |
0 commit comments