diff --git a/网工二班202014050208宋琪.py b/网工二班202014050208宋琪.py new file mode 100644 index 0000000..d585bf7 --- /dev/null +++ b/网工二班202014050208宋琪.py @@ -0,0 +1,24 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig,ax = plt.subplots() +#配置中文显示 +plt.rcParams['font.family'] = ['SimHei'] +plt.rcParams['axes.unicode_minus'] = False + +def f(t): + return np.cos(2*np.pi*t) + +x1 = np.arange(0.0,4.0,0.5) +x2 = np.arange(0.0,4.0,0.01) +plt.figure(1) + +plt.subplot(2,2,1) +plt.plot(x1,f(x1),'bo',x2,f(x2),'k') +plt.title('子图1') + +plt.subplot(2,2,2) +plt.plot(np.cos(2*np.pi*x2),'r--') +plt.title('子图2') + +plt.show() \ No newline at end of file