visualizer.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:adgm 作者: musyoku 项目源码 文件源码
def plot_z(z, dir=None, filename="z", xticks_range=None, yticks_range=None):
    if dir is None:
        raise Exception()
    try:
        os.mkdir(dir)
    except:
        pass
    fig = pylab.gcf()
    fig.set_size_inches(16.0, 16.0)
    pylab.clf()
    for n in xrange(z.shape[0]):
        result = pylab.scatter(z[n, 0], z[n, 1], s=40, marker="o", edgecolors='none')
    pylab.xlabel("z1")
    pylab.ylabel("z2")
    if xticks_range is not None:
        pylab.xticks(pylab.arange(-xticks_range, xticks_range + 1))
    if yticks_range is not None:
        pylab.yticks(pylab.arange(-yticks_range, yticks_range + 1))
    pylab.savefig("{}/{}.png".format(dir, filename))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号