()
| 665 | return fig |
| 666 | |
| 667 | def PyplotFormatstr(): |
| 668 | |
| 669 | def f(t): |
| 670 | return np.exp(-t) * np.cos(2*np.pi*t) |
| 671 | |
| 672 | t1 = np.arange(0.0, 5.0, 0.1) |
| 673 | t2 = np.arange(0.0, 5.0, 0.02) |
| 674 | |
| 675 | plt.figure(1) |
| 676 | plt.subplot(211) |
| 677 | plt.plot(t1, f(t1), 'bo', t2, f(t2), 'k') |
| 678 | |
| 679 | plt.subplot(212) |
| 680 | plt.plot(t2, np.cos(2*np.pi*t2), 'r--') |
| 681 | fig = plt.gcf() # get the figure to show |
| 682 | return fig |
| 683 | |
| 684 | def UnicodeMinus(): |
| 685 | import numpy as np |