一、绘制误差线 使用errorbar方法可以绘制误差线。 x = np.linspace(0,10,50) dy=0.8 y = np.cos(x) + dy*np.random.randn(50) plt.errorbar(x, y, yerr=dy, fmt='.k') 做一些格式上的调整: p ...
分类:
其他好文 时间:
2020-04-29 11:05:30
阅读次数:
69
一、坐标轴上下限 使用plt.xlim()和plt.ylim()来调整上下限的值: import numpy as np import matplotlib.pyplot as plt x = np.linspace(0,10,100) plt.plot(x,np.sin(x)) plt.xlim( ...
分类:
其他好文 时间:
2020-04-26 11:05:37
阅读次数:
68
1 import matplotlib.pyplot as plt 2 import numpy as np 3 x=np.linspace(-10,10,100) 4 y=np.linspace(-10,10,100) 5 #计算x和y的相交点a 6 X,Y=np.meshgrid(x,y) 7 ...
分类:
其他好文 时间:
2020-04-07 22:38:46
阅读次数:
93
1 import matplotlib.pyplot as plt 2 import numpy as np 3 x = np.linspace(0,10,100) 4 #添加legend()图例,给plot方法添加参数label 5 plt.plot(x,x+0,'--g',label='--g' ...
分类:
其他好文 时间:
2020-04-06 17:38:20
阅读次数:
80
一、折线图 import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2 * np.pi, 100) y1, y2 = np.sin(x), np.cos(x) plt.plot(x, y1, c='r', ls='- ...
分类:
编程语言 时间:
2020-03-04 22:45:55
阅读次数:
81
torch.linspace torch.linspace(start, end, steps) returns a one-dimensional tensor of equally spaced points between [start, end]。steps默认值是100。 torch.ra ...
分类:
其他好文 时间:
2020-02-22 14:16:13
阅读次数:
96
1. Bertrand Triangle r=1; %circle radius x0=0; y0=0; %centre of circle %points for circle t=linspace(0,2*pi,200); xp=r*cos(t); yp=r*sin(t); %angles of ...
分类:
其他好文 时间:
2020-02-20 10:21:47
阅读次数:
67
一些常见激活函数(维基百科) 代码: # -*- coding: UTF-8 -*- import numpy as np import matplotlib.pyplot as plt import tensorflow as tf # 创建输入数据 x = np.linspace(-7, 7, ...
分类:
其他好文 时间:
2020-02-19 20:41:25
阅读次数:
88
那些迷惘的,恐惧的,凌乱的日子中,不断飞舞的指尖,是我划破虚无的利剑。XZ哥哥是我的军旗。 1.画图 import numpy as np from matplotlib import pyplot as plt # flag xf=np.linspace(0,30,100) yf=xf # bad ...
分类:
其他好文 时间:
2020-02-16 22:19:20
阅读次数:
91
代码: #进行批训练 import torch import torch.utils.data as Data BATCH_SIZE = 5 #每批5个数据 if __name__ == '__main__': x = torch.linspace(1, 10, 10) #x是从1到10共10个数据 ...
分类:
其他好文 时间:
2020-02-12 18:14:31
阅读次数:
80