def IDT_group2svg(IDT_group):
IDT_group_dir = IDT_group['IDT_group_dir']
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
svg_filename = tkFileDialog.asksaveasfilename(title='SVG export filename',defaultextension = 'svg',initialdir = IDT_group_dir);
plt_bnds = [0,8000,0,8000]
x0 = 40e-3
y0 = 40e-3
factor = 1e5
fig, ax = plt.subplots()
for polygon in IDT_group['final_IDT']:
polygon = shapely_affinity.translate(polygon, xoff=x0, yoff=y0)
polygon = shapely_affinity.scale(polygon, xfact = factor, yfact= factor, origin=(0,0,0))
patch = PolygonPatch(polygon, fc=BLACK, ec=None, alpha=1.0, zorder=2)
ax.add_patch(patch)
for IDT_data in IDT_group['IDT']:
reticule = IDT_data['reticule']
for polygon in reticule:
polygon = shapely_affinity.translate(polygon, xoff=x0, yoff=y0)
polygon = shapely_affinity.scale(polygon, xfact = factor, yfact= factor, origin=(0,0,0))
patch = PolygonPatch(polygon, fc=BLACK, ec='none', alpha=1.0, zorder=2)
ax.add_patch(patch)
ax.axis(plt_bnds)
ax.set_aspect(1)
#plt.show()
fig.savefig(svg_filename, format='svg', dpi=1200)
评论列表
文章目录