【发布时间】:2016-12-17 23:37:40
【问题描述】:
我已经使用 matplotlib 渲染了这个乳胶表达式,但它已经包装了文本,因此给出了多行输出。
我设置了 wrap = False ,但它仍然这样做
t = plt.text(0.5, 0.5, expr, fontsize=320, fontweight='bold', wrap=False, color='white', horizontalalignment='center',verticalalignment='center')
我不知道为什么它仍然把它换成 3 行。
作为参考,这是正在渲染的乳胶表达式。
$\equiv\ \frac{x^{3}}{3} + \frac{x^{2}}{2} \operatorname{asin}{\left (x \right )} + \frac{x^{2}}{2} + \frac{x}{4} \sqrt{- x^{2} + 1} + \begin{cases} 2 i \sqrt{x - 1} - 2 \log{\left (\sqrt{x} \right )} + \log{\left (x \right )} + 2 i \operatorname{asin}{\left (\frac{1}{\sqrt{x}} \right )} & \text{for}\: \left|{x}\right| > 1 \\2 \sqrt{- x + 1} + \log{\left (x \right )} - 2 \log{\left (\sqrt{- x + 1} + 1 \right )} & \text{otherwise} \end{cases} - \frac{1}{4} \operatorname{asin}{\left (x \right )}$
我怎样才能得到想要的结果?
【问题讨论】:
-
您需要提供minimal reproducible example。
equiv后面的反斜杠是什么意思? -
equiv 前面的多余反斜杠已被删除,但它仍然不重要,乳胶表达式本身并不重要,问题在于 matplotlib 因为它正在对表达式进行文本包装,我不希望这种情况发生,所以我正在询问如何克服@Im
-
在下面查看我的回答,了解如何克服这个问题。
标签: python matplotlib latex