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 ade2413 commit 8d28a94Copy full SHA for 8d28a94
fig/chap3/tanh.png
22.9 KB
fig/chap3/tanh.py
@@ -0,0 +1,22 @@
1
+"""
2
+tanh
3
+~~~~
4
+
5
+Plots a graph of the tanh function."""
6
7
+import numpy as np
8
+import matplotlib.pyplot as plt
9
10
+z = np.arange(-5, 5, .1)
11
+t = np.tanh(z)
12
13
+fig = plt.figure()
14
+ax = fig.add_subplot(111)
15
+ax.plot(z, t)
16
+ax.set_ylim([-1.0, 1.0])
17
+ax.set_xlim([-5,5])
18
+ax.grid(True)
19
+ax.set_xlabel('z')
20
+ax.set_title('tanh function')
21
22
+plt.show()
0 commit comments