摘要:
import matplotlib.pyplot as plt import random # 1.准备数据 x = range(60) y_shanghai = [random.uniform(15, 18) for i in x] y_beijing = [random.uniform(1, 3) for i in x] # 2.创建画布 # plt.figure(figsize=(10, ... 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt # 1.数据准备 x = np.random.randn(30) y = np.random.randn(30) # 2.创建画布 plt.figure(figsize=(10, 4), dpi=80) # 3.绘制图像 plt.scatter(x, y) # 4.显示图像 plt.show() 阅读全文
摘要:
import numpy as np import matplotlib.pyplot as plt # 1.准备数据 x = np.linspace(-1, 1, 1000) y = 2 * x * x # 2.创建画布 plt.figure(figsize=(10, 4), dpi=80) # 3.绘制图像 plt.plot(x, y) # 添加网络显示 plt.grid(linestyle= 阅读全文
摘要:
import matplotlib.pyplot as plt # 1.数据准备 # 房屋面积数据 movie_names = ["雷神3","正义联盟","A","B","C","D","E"] # 房屋价格数据 tickets = [73853, 57767,22354,15969,14839,8716,52222] # 2.创建画布 plt.figure(figsize=(10, 4), ... 阅读全文
摘要:
import matplotlib.pyplot as plt move_name = ["雷神3", "速度与激情4", "正义联盟", "蜘蛛侠", "闪电侠", "绿巨人", "阿凡达"] place_count = [13270, 9945, 7679, 6799, 6101, 4621, 20105] # 创建画布 plt.figure(figsize=(10, 8), dpi=80)... 阅读全文