我正在尝试在四个数字标签上标出两个小数位-例如“ 1475.88”到我的X轴上。如您所见,该标签已被Matplotlib缩短为科学格式1.478e3。
如何以规定的间隔显示完整图形。
以下代码:
with plt.style.context('seaborn-whitegrid'):
# Plot the SVP data
plt.figure(figsize=(8,8))
plt.plot(speed_x_clean,depth_y_clean)
plt.plot(smoothed_speed,smoothed_depth)
plt.scatter(float(speed_extrapolated),float(depth_extrapolated),marker='X',color='#ff007f')
# Add a legend,labels and titla
plt.gca().invert_yaxis()
plt.legend(('Raw SVP','Smoothed SVP'),loc='best')
plt.title('SVP - ROV '+ '['+ time_now + ']')
plt.xlabel('Sound Velocity [m/s]')
plt.ylabel('Depth [m]')
# plt.grid(color='grey',linestyle='--',linewidth=0.25,grid_animated=True)
ax = plt.axes()
plt.gca().xaxis.set_major_locator(plt.AutoLocator())
plt.xticks(rotation=0)
plt.show()