【发布时间】:2022-10-16 23:02:35
【问题描述】:
我正在使用 Plotly 为一篇研究文章生成我的数据。我需要以 EPS 或 PDF 格式导出我的图形,如果我以 PNG 格式导出,我会遇到一个不会出现的问题。
导出图形时,LaTeX 字符串变粗。 我不知道如何解决这个问题。你知道有什么命令可以消除这种粗体效果吗?
这是编写标签的python代码,例如
fig.update_yaxes(row=1, col=1, title=r"$\boldsymbol{\tau} \; \text{(N)}$")
for i in range(2, rows + 1):
fig.update_yaxes(row=i, col=1, title=r"$\boldsymbol{\tau} \; \text{(Nm)}$")
for i in range(1, cols + 1):
fig.update_xaxes(row=rows, col=i, title=r"$\text{Time (s)}$")
这就是我导出图形的方式:
fig.write_image(out_path_file + "/q_integrated.png")
fig.write_image(out_path_file + "/q_integrated.pdf")
fig.write_html(out_path_file + "/q_integrated.html", include_mathjax="cdn")
fig.write_image(out_path_file + "/q_integrated.eps")
【问题讨论】:
-
minimal reproducible example 可能会有所帮助。
标签: python plotly latex plotly-python export-to-pdf