Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b1395be

Browse files
committed
Merge pull request matplotlib#4649 from ericmjl/mep12-symlog_demo.py
MEP12 changes on symlog_demo.py
2 parents f5856aa + 22f0291 commit b1395be

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed
Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
#!/usr/bin/env python
2-
from pylab import *
32

4-
dt = 0.01
5-
x = arange(-50.0, 50.0, dt)
6-
y = arange(0, 100.0, dt)
3+
import matplotlib.pyplot as plt
4+
import numpy as np
75

8-
subplot(311)
9-
plot(x, y)
10-
xscale('symlog')
11-
ylabel('symlogx')
12-
grid(True)
13-
gca().xaxis.grid(True, which='minor') # minor grid on too
6+
dt = 0.01
7+
x = np.arange(-50.0, 50.0, dt)
8+
y = np.arange(0, 100.0, dt)
149

15-
subplot(312)
16-
plot(y, x)
17-
yscale('symlog')
18-
ylabel('symlogy')
10+
plt.subplot(311)
11+
plt.plot(x, y)
12+
plt.xscale('symlog')
13+
plt.ylabel('symlogx')
14+
plt.grid(True)
15+
plt.gca().xaxis.grid(True, which='minor') # minor grid on too
1916

17+
plt.subplot(312)
18+
plt.plot(y, x)
19+
plt.yscale('symlog')
20+
plt.ylabel('symlogy')
2021

21-
subplot(313)
22-
plot(x, np.sin(x / 3.0))
23-
xscale('symlog')
24-
yscale('symlog', linthreshy=0.015)
25-
grid(True)
26-
ylabel('symlog both')
22+
plt.subplot(313)
23+
plt.plot(x, np.sin(x / 3.0))
24+
plt.xscale('symlog')
25+
plt.yscale('symlog', linthreshy=0.015)
26+
plt.grid(True)
27+
plt.ylabel('symlog both')
2728

28-
show()
29+
plt.show()

0 commit comments

Comments
 (0)