-
Notifications
You must be signed in to change notification settings - Fork 2
/
2Dplots.py
93 lines (79 loc) · 2.66 KB
/
2Dplots.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
#-------------------------careful tokens ----------------------------------
x1 = np.asarray([0, 0])
y1 = np.asarray([-1, 1])
x2 = np.asarray([-1, 1])
y2 = np.asarray([0, 0])
fig, ax = plt.subplots()
ax.plot(x1, y1)
ax.plot(x2, y2)
ax.scatter(1, 1, c='red', marker='o', s=200)
ax.scatter(1, -1, c='red', marker='o', s=200)
ax.text(0.8, 0.85, '%s' %('State 1'), size=8, zorder=1)
ax.text(0.8, -0.85, '%s' %('State 2'), size=8, zorder=1)
ax.set_xlim(-1, 1)
ax.set_xticks((1, 0.5, 0, -0.5, -1))
ax.set_ylim(-1, 1)
ax.set_yticks((1, 0.5, 0, -0.5, -1))
ax.text(0.4, 0.5, r'Ideal')
ax.text(-0.7, 0.5, r'No takeoff')
ax.text(-0.7, -0.5, r'No takeoff')
ax.text(0.3, -0.5, r'Danger Zone')
ax.set(xlabel='User compliance', ylabel='Perceived token intent',
title='Token design: careful')
fig.savefig("Careful_tokens.png")
plt.show()
if 0:
#-------------------------careless tokens ----------------------------------
x1 = np.asarray([0, 0])
y1 = np.asarray([-1, 1])
x2 = np.asarray([-1, 1])
y2 = np.asarray([0, 0])
fig, ax = plt.subplots()
ax.plot(x1, y1)
ax.plot(x2, y2)
ax.set_xlim(-1, 1)
ax.set_xticks((1, 0.5, 0, -0.5, -1))
ax.set_ylim(-1, 1)
ax.set_yticks((1, 0.5, 0, -0.5, -1))
ax.text(0.3, 0.6, r'Compliant')
ax.text(0.3, 0.4, r'Community')
ax.text(-0.7, 0.5, r'Road to Hell')
ax.text(-0.6, -0.5, r'Swamp')
ax.text(0.3, -0.5, r'Danger Zone')
ax.set(xlabel='User compliance', ylabel='Perceived token intent',
title='Token design: careless')
fig.savefig("Careless_tokens_simple.png")
plt.show()
if 0:
#-------------------------careless tokens with compliant range----------------------------------
x1 = np.asarray([0, 0])
y1 = np.asarray([-1, 1])
x2 = np.asarray([-1, 1])
y2 = np.asarray([0, 0])
#compliant range
xc = np.asarray([-0.5, -0.5])
yc = np.asarray([-1, 1])
xn = np.asarray([0.7, 0.7])
yn = np.asarray([-1, 1])
fig, ax = plt.subplots()
ax.plot(x1, y1)
ax.plot(x2, y2)
ax.plot(xc, yc, '--', label="max cheaters")
ax.plot(xn, yn, '--', label="max compliant")
ax.legend(loc='lower right')
ax.set_xlim(-1, 1)
ax.set_xticks((1, 0.5, 0, -0.5, -1))
ax.set_ylim(-1, 1)
ax.set_yticks((1, 0.5, 0, -0.5, -1))
ax.text(0.3, 0.6, r'Compliant')
ax.text(0.3, 0.4, r'Community')
ax.text(-0.7, 0.5, r'Road to Hell')
ax.text(-0.6, -0.5, r'Swamp')
ax.text(0.3, -0.5, r'Danger Zone')
ax.set(xlabel='User compliance', ylabel='Perceived token intent',
title='Token design: careless')
fig.savefig("Careless_tokens_range.png")
plt.show()