質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,6 +38,130 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
+
追記
|
42
|
+
|
43
|
+
```Python
|
44
|
+
|
45
|
+
d = genfromtxt("example.csv", delimiter=",") # データ読み込み 計画線量
|
46
|
+
|
47
|
+
"tail -f aiueo.csv | python this program.py"
|
48
|
+
|
49
|
+
with open('aiueo.csv', 'rb') as f:
|
50
|
+
|
51
|
+
rows = csv.reader(sys.stdin)
|
52
|
+
|
53
|
+
next(rows) # ヘッダを捨てる
|
54
|
+
|
55
|
+
for row in rows:
|
56
|
+
|
57
|
+
print float(row[0]) # 最初のカラムを数値として表示
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
fig = pyplot.figure(figsize=(16,9))
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
# 全体を2x2に分割し、1枚目(左半分)に描写
|
68
|
+
|
69
|
+
ax = fig.add_subplot(121, projection='3d')
|
70
|
+
|
71
|
+
ax.set_xlabel("X-axis")
|
72
|
+
|
73
|
+
ax.set_ylabel("Y-axis")
|
74
|
+
|
75
|
+
ax.set_zlabel("Z-axis")
|
76
|
+
|
77
|
+
ax.set_xlim(-30, 30)
|
78
|
+
|
79
|
+
ax.set_ylim(-40, 20)
|
80
|
+
|
81
|
+
ax.set_zlim(100, 200)
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
ax.plot(d[:,0], d[:,1], d[:,2], "o", color="g", ms=16, mew=0.5)
|
86
|
+
|
87
|
+
ax.plot(row[:,8], row[:,9], row[:,10], "x", color="r", ms=16, mew=0.5)
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
ax.grid(True)
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
# 全体を2x2に分割し、2枚目(右上)に描写
|
96
|
+
|
97
|
+
ax = fig.add_subplot(222)
|
98
|
+
|
99
|
+
ax.set_xlabel('X-axis')
|
100
|
+
|
101
|
+
ax.set_ylabel('Y-axis')
|
102
|
+
|
103
|
+
ax.set_xlim(-30, 30)
|
104
|
+
|
105
|
+
ax.set_ylim(-40, 20)
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
ax.plot(d[:,0], d[:,1], "o", color="g", ms=24, mew=0.5)
|
110
|
+
|
111
|
+
ax.plot(row[:,8], row[:,9], "x", color="r", ms=24, mew=0.5)
|
112
|
+
|
113
|
+
ax.grid(True)
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
# 全体を2x2に分割し、3枚目(右下) に描写
|
120
|
+
|
121
|
+
ax = fig.add_subplot(224)
|
122
|
+
|
123
|
+
ax.set_xlabel('Z-axis')
|
124
|
+
|
125
|
+
ax.set_ylabel('Y-axis')
|
126
|
+
|
127
|
+
ax.set_xlim(100, 200)
|
128
|
+
|
129
|
+
ax.set_ylim(-40,20)
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
ax.plot(d[:,2], d[:,1], "o", color="g", ms=24, mew=0.5)
|
134
|
+
|
135
|
+
ax.plot(row[:,10], row[:,9], "x", color="r", ms=24, mew=0.5)
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
ax.grid(True)
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
f.close()
|
148
|
+
|
149
|
+
cv2.destroyAllWindows()
|
150
|
+
|
151
|
+
src.release()
|
152
|
+
|
153
|
+
rec.release()
|
154
|
+
|
155
|
+
fig.show()
|
156
|
+
|
157
|
+
pyplot.pause(0.1)
|
158
|
+
|
159
|
+
```
|
160
|
+
|
161
|
+
pyplot.pause(interval)にしたら上手くいくかも?みたいな記事を読んでみたのですがそれでも失敗しました。
|
162
|
+
|
163
|
+
|
164
|
+
|
41
165
|
|
42
166
|
|
43
167
|
###補足情報(言語/FW/ツール等のバージョンなど)
|