import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import itertools
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
with open('data') as f:
for points in zip(*[itertools.ifilter(lambda line: line.strip(),f)]*3):
points=([tuple(map(float,p.strip().split())) for p in points])
ax.add_patch(patches.Polygon(points))
ax.autoscale_view()
plt.show()
Using the data you posted:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import itertools
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
with open('data') as f:
for points in zip(*[itertools.ifilter(lambda line: line.strip(),f)]*3):
points=([tuple(map(float,p.strip().split())) for p in points])
ax.add_patch(patches.Polygon(points))
ax.autoscale_view()
plt.show()
发布评论
评论(2)
快速浏览一下 艺术家演示
a quick look at artist demo
使用您发布的数据:
Using the data you posted: