matplotlib绘图(2)
plt.bar
colors=["#348ABD","#A60628"]
plt.bar([0,.7], prior, alpha=0.70, width=0.25, color...width=0.25,
color=colors[1],label="posterior dis", lw="3",edgecolor="#A60628")
#第一个参数:x轴位置,第二个参数:位置对应的值,...0.10,0.95], ["Librarian", "Farmer"])
#设置label
plt.set_xlabel("string")
plt.set_ylabel("string")
实例
%matplotlib...inline
import numpy as np
from matplotlib import pyplot as plt
colors=["#348ABD","#A60628"]
prior =...0.10,0.95], ["Librarian", "Farmer"])
plt.title(".......")
plt.ylabel("Prob")
plt.legend(loc="upper left")
matplotlib.legend.Legend