摘要: import matplotlib.pyplot as plt import numpy as np n = 1024 X = np.random.normal(0,1,n)#是生成的数平均值是0,方差是1 Y = np.random.normal(0,1,n) T = np.arctan2(Y,X)#颜色 plt.scatter(X,Y,s = 75,c = T,alpha=0.5)... 阅读全文
posted @ 2018-12-25 11:27 科大小黑 阅读(957) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt import numpy as np x = np.linspace(-3, 3, 50) y = 2*x + 1 plt.figure(num=1, figsize=(8, 5),) plt.plot(x, y,) ax = plt.gca() ax.spines['right'].set_color('none')#右边... 阅读全文
posted @ 2018-12-25 11:10 科大小黑 阅读(204) 评论(0) 推荐(0) 编辑
摘要: loc可用参数: 阅读全文
posted @ 2018-12-25 11:08 科大小黑 阅读(1162) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt import numpy as np x = np.linspace(-3,3,50)#从-3到3设置50个点 #设置两个函数 y1 = 2 * x + 1 y2 = x ** 2 plt.figure() plt.plot(x,y2) plt.plot(x,y1,color = 'red',linewidth = 1.0,li... 阅读全文
posted @ 2018-12-25 11:03 科大小黑 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1. 执行python脚本的两种方式 1>就是通过寻找文件,打开python.exe 2>利用cmd 将python解释器和.py文件放一块 2. 简述位、字节的关系 8位是一个字节,操作系统是按字节执行,计算机是按位存储 3. 在utf-8中一个汉字占用3个字节,而在python3中解释器是按照字 阅读全文
posted @ 2018-12-25 11:03 科大小黑 阅读(85) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt import numpy as np x = np.linspace(-3,3,50)#从-3到3设置50个点 #设置两个函数 y1 = 2 * x + 1 y2 = x ** 2 plt.figure() plt.plot(x,y2) plt.plot(x,y1,color = 'red',linewidth = 1.0,li... 阅读全文
posted @ 2018-12-25 11:01 科大小黑 阅读(581) 评论(0) 推荐(0) 编辑
摘要: # import numpy as np # import matplotlib.pyplot as plt # # x = np.linspace(-1, 1, 50) # y1 = 2 * x + 1 # # # figure 1 # plt.figure() # plt.plot(x, y1) # # # # figure 2 # y2 = x**2 # plt.figure() # pl... 阅读全文
posted @ 2018-12-25 10:59 科大小黑 阅读(214) 评论(0) 推荐(0) 编辑