【发布时间】:2018-04-26 09:38:00
【问题描述】:
我想在我的图中使用大括号“}”,它们都具有不同的高度,但宽度相同。 到目前为止,缩放文本时,宽度按比例缩放:
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1])
ax.text(0.2, 0.2, '}', fontsize=20)
ax.text(0.4, 0.2, '}', fontsize=40)
plt.show()
我想到的唯一想法是用 matplotlib 图像覆盖大括号图像,例如使用svgutils 就像在Importing an svg file a matplotlib figure 中一样,但这很麻烦。
以矢量图形作为输出的解决方案将是理想的。
【问题讨论】:
-
我确实认为使用
LaTeX文本渲染和\scalebox可以在这里完成这项工作,但似乎doesn't work。
标签: python matplotlib svg