【问题标题】:How to add a hyperlink to a figure using Python?如何使用 Python 为图形添加超链接?
【发布时间】:2023-02-06 17:50:31
【问题描述】:

我正在生成直方图和饼图(使用 pandas)以进行描述性分析演示,观众希望单击图表以转到图表的数据/excel 文件。

有没有办法在生成数字时自动执行此“超链接”?

我看过 (https://docs.eyesopen.com/toolkits/python/depicttk/svg.html),但我不确定如何根据我的场景实施它。

任何指导将不胜感激

【问题讨论】:

    标签: python pandas matplotlib svg hyperlink


    【解决方案1】:

    添加超链接: p = shape.text_frame.paragraphs r = p.add_run() r.text = 'link to python-pptx @ GitHub' hlink = r.hyperlink hlink.address = 'https://github.com/scanny /python-pptx' 删除超链接: r.hyperlink = None # or ------------ r.hyperlink.address = None # empty string '' will do it too

    【讨论】:

      猜你喜欢
      • 2017-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-03
      • 2018-09-25
      • 1970-01-01
      • 2012-05-07
      • 1970-01-01
      相关资源
      最近更新 更多