如何使Matplotlib.pyplot停止强制我的标记风格?
为了使 matplotlib.pyplot 停止强制标记风格,我们可以采取以下步骤:
- 设置图形大小并调整子图之间和周围的填充。
- 使用numpy创建随机 x 和 y 数据点。
- 使用 plot() 方法绘制 x 和 y 数据点,使用 “r *” 标记,大小为 10 。
- 使用 show() 方法显示图形。
例子
from matplotlib import pyplot as plt
import numpy as np
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
x = np.random.rand(20)
y = np.random.rand(20)
plt.plot(x, y, 'r*', markersize=10)
plt.show()