Matplotlib plot:增加数据点的大小

Matplolib plot: Increase the size of data points

我正在尝试绘制 numpy 数组 x_trainy_train。我正在使用 matplotlib 的 plot 函数,我想传递一个参数来增加数据点的大小。这是我的代码:

x_train = np.array([0.        , 0.10526316, 0.21052632, 0.31578947, 0.42105263,
       0.52631579, 0.63157895, 0.73684211, 0.84210526, 0.94736842,
       1.05263158, 1.15789474, 1.26315789, 1.36842105, 1.47368421,
       1.57894737, 1.68421053, 1.78947368, 1.89473684, 2.        ])

y_train = np.array([0.2260415, 0.08966768, -0.02649684, -0.1024971,   0.14580953, 
0.03593453, 0.14398569,  0.30298584,  0.51058752,  0.43602841,  0.50852418,
  1.05403315, 1.27155675,  1.38071476,  1.62995731,  1.6434204,   1.64367346,
  1.54763514, 1.47964281,  0.97544995])

plt.figure(figsize=(20,10))

plt.plot(x_train, y_train, '*', color='black', label='Train values with noise')

使用markersize(快捷方式:ms):

plt.plot(x_train, y_train, '*', color='black', label='Train values with noise', ms=12)

使用'markersize'作为点的大小,如示例:

plt.plot(x_train, y_train, '*', color='black', label='Train values with noise', markersize = 20)