summaryrefslogtreecommitdiff
path: root/project/scripts/minus_one_scatter.py
diff options
context:
space:
mode:
Diffstat (limited to 'project/scripts/minus_one_scatter.py')
-rwxr-xr-xproject/scripts/minus_one_scatter.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/project/scripts/minus_one_scatter.py b/project/scripts/minus_one_scatter.py
new file mode 100755
index 0000000..4b26a4f
--- /dev/null
+++ b/project/scripts/minus_one_scatter.py
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+
+
+import numpy as np
+import matplotlib.pyplot as plt
+
+
+plt.rcParams['legend.fontsize'] = 10
+
+fig = plt.figure ()
+ax = fig.gca ()
+
+data = np.array([
+ [-2, 1],
+ [-1,-1],
+ [ 0, 1],
+ [ 1,-1],
+ [ 2, 1]
+])
+x, y = data.T
+
+ax.set_xticks ([-2, -1, 1, 2])
+ax.spines['left'].set_position ('center')
+ax.spines['right'].set_position ('center')
+
+ax.set_yticks ([-1, -0.5, 0.5, 1])
+ax.spines['top'].set_position ('center')
+ax.spines['bottom'].set_position ('center')
+
+plt.scatter (x, y, label='$y=(-1)^{x}$')
+ax.legend ()
+
+plt.show ()
+