假设我们有这些数据:
import matplotlib.pyplot as plt
import numpy as np
Y = np.array([500., 1000., 1500., 2000., 2500., 3000., 3500., 4000.,
4500., 5000., 5500., 6000., 6500., 7000., 7500., 8000.,
8500., 8999.])
P = np.array([0.35719454, 1.33640227, 3.6250187 , 4.6098672 , 3.07393609,
3.37146857, 3.63601765, 4.22452476, 3.89485839, 4.1829315 ,
4.02657142, 4.17620968, 4.06966698, 4.18009466, 4.16220121,
4.60149918, 4.31294132, 3.94933813])
plt.plot(Y,P)
plt.show()
我怎样才能使它平滑一点,同时在 x 轴上表示的每个元素上绘制一个标记?有没有办法做到这一点?