summaryrefslogtreecommitdiff
path: root/project/scripts/minus_one_exp_x.py
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2018-12-29 12:45:47 +1100
committerJed Barber <jjbarber@y7mail.com>2018-12-29 12:45:47 +1100
commit23b53a46d263a30a466ee0d48543b6ed64f29141 (patch)
tree9bcb57d4370f6edb93caf5ea6605ea211cd776ff /project/scripts/minus_one_exp_x.py
parent78e64f219693800130e53809e5c0ec13b445c9fc (diff)
Article about area under the curve for complex valued integrals
Diffstat (limited to 'project/scripts/minus_one_exp_x.py')
-rwxr-xr-xproject/scripts/minus_one_exp_x.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/project/scripts/minus_one_exp_x.py b/project/scripts/minus_one_exp_x.py
new file mode 100755
index 0000000..7073b47
--- /dev/null
+++ b/project/scripts/minus_one_exp_x.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+
+from mpl_toolkits.mplot3d import Axes3D
+import numpy as np
+import matplotlib.pyplot as plt
+
+
+plt.rcParams['legend.fontsize'] = 10
+
+fig = plt.figure ()
+ax = fig.gca (projection='3d')
+
+# the z-axis is vertical in matplotlib
+x = np.linspace (-2, 2, 5000)
+y = np.sin (np.pi * x)
+z = np.cos (np.pi * x)
+
+ax.plot (x, y, z, label='$y=(-1)^{x}$')
+ax.legend ()
+
+ax.set_xlabel ('x', labelpad=7)
+ax.set_xticks ([-2, -1, 0, 1, 2])
+ax.xaxis.set_rotate_label (False)
+
+ax.set_ylabel ('$y_{im}$', labelpad=7)
+ax.set_yticks ([1, 0.5, 0, -0.5, -1])
+ax.invert_yaxis ()
+ax.yaxis.set_rotate_label (False)
+
+ax.set_zlabel ('$y_{re}$', labelpad=7)
+ax.set_zticks ([-1, -0.5, 0, 0.5, 1])
+ax.zaxis.set_rotate_label (False)
+
+plt.show ()
+