带有较大刻度线的问题

时间:2019-07-14 16:45:34

标签: python matplotlib

这是我的情节:

My plot

我尝试使用xticks,但似乎无法解决问题。数量众多似乎是一个问题。我也不理解间距,因为它将从0-> 0.4-> 500-> 1000开始,并且由于某些原因它也会使数字倾斜。它会添加额外的零,我也不明白。

# Create figure for plotting

fig = plt.figure()

#ax1 = fig.add_subplot(211)

plt.title('SensorTile Project')

ax2 = fig.subplots()

#ax1.set(ylabel='Displacement (mm)')

ax2.set(ylabel='Acceleration (mg) X & Y')
ax2.set(xlabel='Time (ms)')

# plot parameters

x_len = 200

#dis_range = [-1000, 1000]

#set tick marks


accel_range = [-1500, 1500]
accel_domain = [0,200]
xs = list(range(0, 200))

ys1 = [0] * x_len

ys2 = [0] * x_len



#ax1.set_ylim(dis_range)

#line1, = ax1.plot(xs, ys1, animated=True)

ax2.set_ylim(accel_range)
ax2.set_xlim(accel_domain)
line1, = ax2.plot(xs, ys1, animated=True)
line2, = ax2.plot(xs, ys2, animated=True)

0 个答案:

没有答案