为什么符号' - '在' y'中省略使用科学记数法时的轴

时间:2014-04-22 01:32:02

标签: python graph fonts matplotlib

我使用matplotlib做一些绘图。但是今天我发现在我的绘图中没有显示y轴上的' - '是非常有线的。有人能给我一些解决方案吗?感谢

代码是:

from pylab import *
import numpy
import scipy.io
from matplotlib.font_manager import FontProperties
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Times New Roman'],'size':7})


figure(num=1, figsize=(2.9,2.4), dpi=300, facecolor='w', edgecolor='k')
x = np.linspace(0, 10, 1001, endpoint=True)
y = numpy.power(x/100, 3)
plot(x, y,'k-',label=r"Simulatied $\sigma_x$")
ylim(0,y.max())
ticklabel_format(style='sci',axis='y', scilimits=(0,0))
tight_layout()
savefig("xy.pdf")

https://www.dropbox.com/s/rfpavget4rlyww7/yx.png

似乎这个问题是由字体'times new roman'引起的。如果我将字体更改为“Arial”,则出现“ - ”

 rc('font',**{'family':'sans-serif','sans-serif':['Arial'],'size':20})

https://www.dropbox.com/s/dfd76om86w7ji08/xy.png

0 个答案:

没有答案