散点图
import matplotlib.pyplot as plot
x_list = []
y_list = []
plt.figure('Scatter fig')
ax = plt.gca()
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.scatter(x_list, y_list, c='r', s=20, alpha=0.5)
plt.show()
连线图
import matplotlib.pyplot as plot
x_list = []
y_list = []
plt.figure('Line fig')
ax = plt.gca()
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.plot(x_list, y_list, color='r', linewidth=1, alpha=0.6)
plt.show()
直方图
import matplotlib.pyplot as plot
x_list = []
y_list = []
plt.figure('Bar fig')
ax = plt.gca()
ax.set_xlabel('value')
ax.set_ylabel('count')
xticks = np.arange(1, len(x_list)+1)
bar_width=0.5
ax.bar(xticks, y_list, width=bar_width, edgecolor='none')
ax.set_xticks(xticks)
ax.set_xticklabels(x_list)
ax.set_xlim(0,len(xticks))
plt.show()