import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.family'] = 'SimHei'
matplotlib.rc('figure', figsize=(20, 5))
p1 = plt.bar(df["TradeDate"],df["Total price"], width=0.5)
plt.title("房价与年份的关系",size=30)
plt.xlabel("x")
plt.ylabel("y")
plt.show()
import matplotlib.pyplot as plt
import pandas as pd
plt.scatter(df["Total price"], df["Total price"], c=color[1], edgecolors='r')
plt.xlim(0,10000)
plt.ylim(0,10000)
plt.title("房价分析")
plt.xlabel("x")
plt.ylabel("y")
plt.show()
import matplotlib.pyplot as plt
def bar1():
price=[1000,2500,6000,6000,9000]
plt.bar(np.arange(5),price,align='center',color='green',alpha=1.0)
plt.xticks(np.arange(5),["北京","武汉","石家庄","唐山","秦皇岛"])
plt.title(r"$price$")
plt.ylabel("price(W)")
bar1()