【问题标题】:image to html using mpld3使用 mpld3 将图像转换为 html
【发布时间】:2018-03-30 09:57:36
【问题描述】:

我正在尝试使用 mpld3 导出图形的 html

import matplotlib.pyplot as plt, mpld3
obj, = plt.plot([3,1,4,1,5], 'ks-', mec='w', mew=5, ms=20)
mpld3.save_html(obj,'C:\\Users\\prabhat.mishra\\Desktop\\figure.html')


作为AttributeError: 'Line2D' object has no attribute 'canvas 面临的问题

【问题讨论】:

    标签: python matplotlib mpld3


    【解决方案1】:

    找出solution

    import matplotlib.pyplot as plt, mpld3
    fig = plt.figure()
    obj, = plt.plot([3,1,4,1,5])
    mpld3.save_html(fig,"C:\\Users\\prabhat.mishra\\Desktop\\figure1.html")
    

    您需要将图形对象传递给save_html

    【讨论】:

      猜你喜欢
      • 2016-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-02
      • 2010-10-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多