我有一个图,其中y标签上有一个数量级的上标,我用下面的一行:
# plt is acquired from matplotlib.pyplot
# orderMagnitude is a variable taken from a different part of the code
plt.ylabel('${\mathrm{Intensity (10^'+str(int(orderMagnitude))+')}}$')
添加{\mathrm{..}}
部分是因为没有它,整个文本将是斜体(除了实际数字)。我现在看到的这条线似乎去掉了y(强度)和开头“(”之间的空白,但似乎在orderMagnitude之后添加了一些空白(见图)。在
有人知道为什么会这样吗?在
你不需要把整条线都置于数学模式,那是你遇到麻烦的一部分。尤其是,您将整个等式放在\mathrm{}中,而不是仅仅
{Intensity }
。下面的内容可能会更好,您不应该在结尾处获得额外的空白:相关问题 更多 >
编程相关推荐