matplotlib.pyplot 的 scatter、plot 模块初涉
matplotlib.markers 处理标记的函数;使用的标记物的功能 plot,scatter和 errorbar。 所有可能的标记都在这里定义:
![]()


import matplotlib.pyplot as plt
import numpy as np
# x = np.floor(10*np.random.rand(6))
x = np.array([1,2,3,4,5,6])
y = x
plt.scatter(x,y)
plt.show()
plt.scatter(x,y,s=300)
plt.scatter(x,y,s=300,c='r')

plt.scatter(x,y,s=300,c='r',marker='^')
![]()
plt.scatter(x,y,s=300,c='r',marker='^',alpha=0.5)
![]()
plt.scatter(x,y,s=300,c='r',marker='^',alpha=0.5,linewidths=7)
![]()
plt.scatter(x,y,s=300,c='r',marker='^',alpha=0.5,linewidths=7,edgecolors='g')
![]()
官网:
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html#matplotlib.pyplot.scatter
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html








浙公网安备 33010602011771号