test_line_orthopy.py 文件源码

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

项目:orthopy 作者: nschloe 项目源码 文件源码
def test_logo():
    import matplotlib.pyplot as plt

    max_n = 6
    moments = numpy.zeros(2*max_n)
    moments[0] = 2.0 / 3.0
    moments[2] = 8.0 / 45.0
    for n in range(max_n):
        _, _, b, c = orthopy.line.recurrence_coefficients.legendre(
            2*n, standardization='p(1)=1'
            )
        alpha, beta = \
            orthopy.line.chebyshev_modified(moments[:2*n], b, c)
        orthopy.line.plot(1, len(alpha)*[1], alpha, beta, -1.0, +1.0)

    plt.xlim(-1, +1)
    plt.ylim(-2, +2)
    plt.grid()
    plt.tick_params(
            axis='both',
            which='both',
            left='off',
            labelleft='off',
            bottom='off',
            labelbottom='off',
            )
    plt.gca().set_aspect(0.25)
    plt.show()
    # plt.savefig('logo.png', transparent=True)
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号