标签:range plot rcp https idt col 虚拟环境 numpy 图片
虚拟环境
#1
from matplotlib import pyplot as plt
x = range(2,26,2)
y = [15,13,14.5,17,20,25,26,26,24,22,18,15]
plt.figure(figsize=(20,8),dpi=80)
plt.rc("lines", linewidth=2, color='g')
plt.plot(x, y)
plt.xticks(range(2,25))
plt.show()
#2 饼图
import numpy as np
from matplotlib import pyplot as plt
t = np.arange(0.0, 1.0, 0.01)
s = np.sin(2 * np.pi * t)
plt.rcParams['lines.color'] = 'r'
plt.plot(t, s)
c = np.cos(2 * np.pi * t)
plt.rcParams['lines.linewidth'] = '3'
plt.plot(t,c)
plt.show()
#3 正反余弦
import numpy as np
t = np.arange(0.0, 1.0, 0.01)
s = np.sin(2 * np.pi * t)
plt.rcParams['lines.color'] = 'r'
plt.plot(t, s)
c = np.cos(2 * np.pi * t)
plt.rcParams['lines.linewidth'] = '3'
plt.plot(t,c)
plt.show()
标签:range plot rcp https idt col 虚拟环境 numpy 图片
原文地址:https://www.cnblogs.com/g2thend/p/12302454.html