forked from ZJouba/virtual_creatures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
question.py
29 lines (20 loc) · 791 Bytes
/
question.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
from Tools.Classes import Limb
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.ticker import MultipleLocator
import numpy as np
limb = Limb()
orientation_vector = ["TOP", "BOTTOM", "TOP", "TOP",
"BOTTOM", "TOP", "BOTTOM", "TOP", "TOP", "BOTTOM", "TOP", "BOTTOM", "TOP", "TOP", "BOTTOM", ]
limb.build(orientation_vector)
segs = limb.XY.shape[1]
points = limb.XY
fig, ax = plt.subplots()
# ax.set_title("Soft actuator\n" + "Number of segments: {}".format(segs))
ax.plot([0, 0], [-2, 2], color='black')
ax.xaxis.set_major_locator(MultipleLocator(1))
"""------ACTUATED-------"""
ax.plot(points[0, :], points[1, :], color='red',
label="Final pressure (P=P" + r'$_f$' + ")")
ax.set_aspect('equal', adjustable='datalim')
plt.show()