Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6741ddf commit d62ec3fCopy full SHA for d62ec3f
1 file changed
examples/api/engineering_formatter.py
@@ -7,13 +7,15 @@
7
8
from matplotlib.ticker import EngFormatter
9
10
+prng = np.random.RandomState(123)
11
+
12
fig, ax = plt.subplots()
13
ax.set_xscale('log')
-formatter = EngFormatter(unit='Hz', places=1)
14
+formatter = EngFormatter(unit='Hz')
15
ax.xaxis.set_major_formatter(formatter)
16
17
xs = np.logspace(1, 9, 100)
-ys = (0.8 + 0.4*np.random.uniform(size=100))*np.log10(xs)**2
18
+ys = (0.8 + 0.4 * prng.uniform(size=100)) * np.log10(xs)**2
19
ax.plot(xs, ys)
20
21
plt.show()
0 commit comments