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

Skip to content

Commit 149fabd

Browse files
committed
pep8 changes on newscalarformatter_demo.py
1 parent 6e932aa commit 149fabd

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed
Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,92 @@
11
# from pylab import *
2-
import matplotlib.pyplot as plt
3-
import numpy as np
2+
import matplotlib.pyplot as plt
3+
import numpy as np
44
from matplotlib.ticker import OldScalarFormatter, ScalarFormatter
55

66
x = np.arange(0, 1, .01)
77
f = plt.figure(figsize=(6, 6))
8-
f.text(0.5, 0.975, 'The old formatter', horizontalalignment='center', verticalalignment='top')
8+
f.text(0.5, 0.975, 'The old formatter',
9+
horizontalalignment='center', verticalalignment='top')
910
plt.subplot(221)
10-
plt.plot(x*1e5 + 1e10, x*1e-10 + 1e-5)
11+
plt.plot(x * 1e5 + 1e10, x * 1e-10 + 1e-5)
1112
plt.gca().xaxis.set_major_formatter(OldScalarFormatter())
1213
plt.gca().yaxis.set_major_formatter(OldScalarFormatter())
1314
plt.subplot(222)
14-
plt.plot(x*1e5, x*1e-4)
15+
plt.plot(x * 1e5, x * 1e-4)
1516
plt.gca().xaxis.set_major_formatter(OldScalarFormatter())
1617
plt.gca().yaxis.set_major_formatter(OldScalarFormatter())
1718
plt.subplot(223)
18-
plt.plot(-x*1e5 - 1e10, -x*1e-5 - 1e-10)
19+
plt.plot(-x * 1e5 - 1e10, -x * 1e-5 - 1e-10)
1920
plt.gca().xaxis.set_major_formatter(OldScalarFormatter())
2021
plt.gca().yaxis.set_major_formatter(OldScalarFormatter())
2122
plt.subplot(224)
22-
plt.plot(-x*1e5, -x*1e-4)
23+
plt.plot(-x * 1e5, -x * 1e-4)
2324
plt.gca().xaxis.set_major_formatter(OldScalarFormatter())
2425
plt.gca().yaxis.set_major_formatter(OldScalarFormatter())
2526

2627
x = np.arange(0, 1, .01)
2728
f = figure(figsize=(6, 6))
28-
f.text(0.5, 0.975, 'The new formatter, default settings', horizontalalignment='center',
29+
f.text(0.5, 0.975, 'The new formatter, default settings',
30+
horizontalalignment='center',
2931
verticalalignment='top')
3032
plt.subplot(221)
31-
plt.plot(x*1e5 + 1e10, x*1e-10 + 1e-5)
33+
plt.plot(x * 1e5 + 1e10, x * 1e-10 + 1e-5)
3234
plt.gca().xaxis.set_major_formatter(ScalarFormatter())
3335
plt.gca().yaxis.set_major_formatter(ScalarFormatter())
3436
plt.subplot(222)
35-
plt.plot(x*1e5, x*1e-4)
37+
plt.plot(x * 1e5, x * 1e-4)
3638
plt.gca().xaxis.set_major_formatter(ScalarFormatter())
3739
plt.gca().yaxis.set_major_formatter(ScalarFormatter())
3840
plt.subplot(223)
39-
plt.plot(-x*1e5 - 1e10, -x*1e-5 - 1e-10)
41+
plt.plot(-x * 1e5 - 1e10, -x * 1e-5 - 1e-10)
4042
plt.gca().xaxis.set_major_formatter(ScalarFormatter())
4143
plt.gca().yaxis.set_major_formatter(ScalarFormatter())
4244
plt.subplot(224)
43-
plt.plot(-x*1e5, -x*1e-4)
45+
plt.plot(-x * 1e5, -x * 1e-4)
4446
plt.gca().xaxis.set_major_formatter(ScalarFormatter())
4547
plt.gca().yaxis.set_major_formatter(ScalarFormatter())
4648

4749
x = np.arange(0, 1, .01)
4850
f = figure(figsize=(6, 6))
49-
f.text(0.5, 0.975, 'The new formatter, no numerical offset', horizontalalignment='center',
51+
f.text(0.5, 0.975, 'The new formatter, no numerical offset',
52+
horizontalalignment='center',
5053
verticalalignment='top')
5154
plt.subplot(221)
52-
plt.plot(x*1e5 + 1e10, x*1e-10 + 1e-5)
55+
plt.plot(x * 1e5 + 1e10, x * 1e-10 + 1e-5)
5356
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useOffset=False))
5457
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useOffset=False))
5558
plt.subplot(222)
56-
plt.plot(x*1e5, x*1e-4)
59+
plt.plot(x * 1e5, x * 1e-4)
5760
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useOffset=False))
5861
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useOffset=False))
5962
plt.subplot(223)
60-
plt.plot(-x*1e5 - 1e10, -x*1e-5 - 1e-10)
63+
plt.plot(-x * 1e5 - 1e10, -x * 1e-5 - 1e-10)
6164
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useOffset=False))
6265
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useOffset=False))
6366
plt.subplot(224)
64-
plt.plot(-x*1e5, -x*1e-4)
67+
plt.plot(-x * 1e5, -x * 1e-4)
6568
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useOffset=False))
6669
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useOffset=False))
6770

6871
x = np.arange(0, 1, .01)
6972
f = figure(figsize=(6, 6))
70-
f.text(0.5, 0.975, 'The new formatter, with mathtext', horizontalalignment='center',
73+
f.text(0.5, 0.975, 'The new formatter, with mathtext',
74+
horizontalalignment='center',
7175
verticalalignment='top')
7276
plt.subplot(221)
73-
plt.plot(x*1e5 + 1e10, x*1e-10 + 1e-5)
77+
plt.plot(x * 1e5 + 1e10, x * 1e-10 + 1e-5)
7478
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useMathText=True))
7579
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useMathText=True))
7680
plt.subplot(222)
77-
plt.plot(x*1e5, x*1e-4)
81+
plt.plot(x * 1e5, x * 1e-4)
7882
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useMathText=True))
7983
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useMathText=True))
8084
plt.subplot(223)
81-
plt.plot(-x*1e5 - 1e10, -x*1e-5 - 1e-10)
85+
plt.plot(-x * 1e5 - 1e10, -x * 1e-5 - 1e-10)
8286
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useMathText=True))
8387
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useMathText=True))
8488
plt.subplot(224)
85-
plt.plot(-x*1e5, -x*1e-4)
89+
plt.plot(-x * 1e5, -x * 1e-4)
8690
plt.gca().xaxis.set_major_formatter(ScalarFormatter(useMathText=True))
8791
plt.gca().yaxis.set_major_formatter(ScalarFormatter(useMathText=True))
8892
plt.show()

0 commit comments

Comments
 (0)