summaryrefslogtreecommitdiff
path: root/project/scripts/minus_one_exp_x.py
diff options
context:
space:
mode:
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 ()
+