Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67c753c

Browse filesBrowse files
committed
mep12 on pstest.py
1 parent 7539b61 commit 67c753c
Copy full SHA for 67c753c

File tree

Expand file treeCollapse file tree

1 file changed

+19
-24
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-24
lines changed

‎examples/pylab_examples/pstest.py

Copy file name to clipboard
+19-24Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
1-
#!/usr/bin/env python
2-
# -*- noplot -*-
3-
import matplotlib
4-
matplotlib.use('PS')
5-
from pylab import *
6-
1+
import matplotlib.pyplot as plt
2+
import numpy as np
73

84
def f(t):
9-
s1 = cos(2*pi*t)
10-
e1 = exp(-t)
11-
return multiply(s1, e1)
12-
13-
t1 = arange(0.0, 5.0, .1)
14-
t2 = arange(0.0, 5.0, 0.02)
15-
t3 = arange(0.0, 2.0, 0.01)
5+
s1 = np.cos(2*np.pi*t)
6+
e1 = np.exp(-t)
7+
return np.multiply(s1, e1)
168

17-
figure(1)
18-
subplot(211)
19-
l = plot(t1, f(t1), 'k^')
20-
setp(l, markerfacecolor='k', markeredgecolor='r')
21-
title('A tale of 2 subplots', fontsize=14, fontname='Courier')
22-
ylabel('Signal 1', fontsize=12)
23-
subplot(212)
24-
l = plot(t1, f(t1), 'k>')
9+
t1 = np.arange(0.0, 5.0, .1)
10+
t2 = np.arange(0.0, 5.0, 0.02)
11+
t3 = np.arange(0.0, 2.0, 0.01)
2512

13+
plt.figure(1)
14+
plt.subplot(211)
15+
l = plt.plot(t1, f(t1), 'k^')
16+
plt.setp(l, markerfacecolor='k', markeredgecolor='r')
17+
plt.title('A tale of 2 subplots', fontsize=14, fontname='Courier')
18+
plt.ylabel('Signal 1', fontsize=12)
19+
plt.subplot(212)
20+
l = plt.plot(t1, f(t1), 'k>')
2621

27-
ylabel('Signal 2', fontsize=12)
28-
xlabel('time (s)', fontsize=12)
22+
plt.ylabel('Signal 2', fontsize=12)
23+
plt.xlabel('time (s)', fontsize=12)
2924

30-
show()
25+
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.