logo.py 文件源码

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

项目:transmutagen 作者: ergs 项目源码 文件源码
def main():
    setup_matplotlib_rc()

    expr = get_CRAM_from_cache(degree, prec)

    c = 0.6*degree

    # Get the translated approximation on [-1, 1]. This is similar logic from CRAM_exp().
    n, d = map(Poly, fraction(expr))
    inv = -c*(t + 1)/(t - 1)
    p, q = map(lambda i: Poly(i, t), fraction(inv))
    n, d = n.transform(p, q), d.transform(p, q)
    rat_func = n/d.TC()/(d/d.TC())
    rat_func = rat_func.evalf(prec)

    plt.clf()
    fig, ax = plt.subplots()

    fig.set_size_inches(4, 4)

    plot_in_terminal(expr - exp(-t), (0, 100), prec=prec, points=points,
        axes=ax)

    # Hide grid lines
    ax.grid(False)

    # Hide axes ticks
    ax.set_xticks([])
    ax.set_yticks([])

    plt.axis('off')
    plt.tight_layout()
    plt.savefig('logo.png', transparent=True, bbox_inches='tight', pad_inches=0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号