我试图显示一个标题为普通文本和两个Latex命令的图像:
plt.imshow(w1subtracted2, origin='lower',
extent=[l_max, -l_max, -b_max, b_max],
cmap = color_map)
plt.title('W1 disk and central $\pm2\textdegree$ subtracted', fontsize = 'small')
plt.xlabel(xlabel, fontsize = 'small')
plt.ylabel(ylabel, fontsize = 'small')
plt.savefig('w1subtracted2.png')
但我无法获得显示\pm
和\textdegree
的标题以Latex样式显示。我怎么才能做到呢?在
似乎您使用的不是latex(
usetext = True
),而是简单的MathText。MathText中没有\textdegree
。在使用
应该给你
尝试通过终端运行代码,因为Spyder或Canopy无法处理Latex命令。在
相关问题 更多 >
编程相关推荐