标签:极限 hid 三角函数 filter war rcc click open and
1 import numpy as np 2 import pandas as pd 3 import matplotlib.pyplot as plt 4 5 import warnings 6 warnings.filterwarnings(‘ignore‘) #不发出警告 7 8 #映射与函数 9 #幂函数 10 if 0: 11 x = np.linspace(-np.pi,2*np.pi,num = 50) 12 y = x**2 13 14 plt.scatter(x,y,marker=‘.‘) 15 plt.plot(x,y) 16 17 #辅助线 18 plt.axvline(0,color =‘cyan‘,linestyle = ‘--‘,alpha = 0.8) 19 plt.axhline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 20 21 22 plt.show() 23 pass 24 #指数函数 25 if 0: 26 x = np.linspace(-np.pi,2*np.pi,num = 50) 27 y = 2**x #指数函数 28 29 plt.scatter(x,y,marker=‘.‘) 30 plt.plot(x,y) 31 32 plt.axhline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 33 plt.axvline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 34 35 plt.show() 36 pass 37 38 #对数函数 39 if 0: 40 x = np.linspace(-np.pi,2*np.pi,num= 50) 41 y = np.log2(x) 42 43 plt.scatter(x,y,marker = ‘.‘) 44 plt.plot(x,y) 45 46 plt.axhline(0,color=‘cyan‘,linestyle = ‘--‘,alpha = 0.8) 47 plt.axvline(0,color=‘cyan‘,linestyle = ‘--‘,alpha = 0.8) 48 49 plt.show() 50 51 52 53 pass 54 55 #三角函数 56 if 0: 57 x = np.linspace(-np.pi,2*np.pi,num=50) 58 y = np.sin(x) 59 60 plt.scatter(x,y,marker =‘.‘) 61 plt.plot(x,y) 62 63 plt.axhline(0,color = ‘cyan‘,linestyle =‘--‘,alpha = 0.8) 64 plt.axvline(0,color=‘cyan‘,linestyle = ‘--‘,alpha = 0.8) 65 66 plt.show() 67 68 pass 69 70 #反三角函数 71 if 0: 72 #f = arcsin(x) 73 x = np.linspace(-np.pi,2*np.pi,num = 100) 74 y = np.arccos(x) 75 76 plt.scatter(x,y,marker = ‘.‘) 77 plt.plot(x,y) 78 79 plt.axhline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 80 plt.axvline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 81 82 plt.show() 83 pass
1 import numpy as np 2 import pandas as pd 3 import matplotlib.pyplot as plt 4 5 # import warnings 6 # warnings.filterwarnings(‘ignore‘) #不发出警告 7 8 #数列 x/(x+1) 的极限 9 if 0: 10 x = np.arange(50) 11 y = x/(x+1) 12 13 plt.scatter(x,y,marker = ‘.‘) 14 plt.plot(x,y) 15 16 plt.axvline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 17 plt.axhline(0,color=‘cyan‘,linestyle=‘--‘,alpha = 0.8) 18 19 plt.show() 20 21 pass 22 23 #函数的极限 24 if 0: 25 x = np.linspace(-2,2,num=100) 26 y = x**2 -1 27 28 plt.scatter(x,y,marker = ‘.‘) 29 plt.plot(x,y) 30 31 plt.axvline(0,color=‘cyan‘,linestyle=‘--‘) 32 plt.axhline(0,color=‘cyan‘,linestyle=‘--‘) 33 34 #极限值 35 plt.axhline(-1,color=‘red‘,linestyle = ‘--‘) 36 plt.show() 37 pass 38 39 40 #练习 :极限 41 #函数的极限 42 if 1: 43 x = np.arange(1,50) 44 y = (2*x+1)/x 45 46 plt.scatter(x,y,marker = ‘.‘) 47 plt.plot(x,y) 48 49 # plt.axhline(2) #默认颜色是类似于 cyan 50 plt.axhline(2,color=‘red‘) #默认是直线 51 52 53 plt.show() 54 pass
标签:极限 hid 三角函数 filter war rcc click open and
原文地址:https://www.cnblogs.com/zach0812/p/11587142.html