随笔分类 - matplotlib
摘要:import numpy from matplotlib import pyplot from matplotlib import animation def update_points(num): point_ani.set_data(x[num],y[num]) #更新点的位置,将这里的(x[n
阅读全文
摘要:from matplotlib import pyplot import numpy def f(x,y): return (1-x/2+x**5)*numpy.exp(-x**2-y**2) n=256 x=numpy.linspace(-3,3,n) y=numpy.linspace(-3,3,
阅读全文
摘要:import numpy from matplotlib import pyplot n=12 x=numpy.arange(12) y1=(1-x/float(n))*numpy.random.uniform(0.5,1.0,n) y2=(1-x/float(n))*numpy.random.un
阅读全文
摘要:from matplotlib import pyplot import numpy n=1024 x=numpy.random.normal(0,1,1024) y=numpy.random.normal(0,1,1024) t=numpy.arctan2(x,y) #代表颜色的数量值 #pypl
阅读全文
摘要:import numpy from matplotlib import pyplot x=numpy.linspace(-3,3,50) y=2*x+1 pyplot.figure(num=1,figsize=(5,5)) pyplot.plot(x,y,linewidth=10,zorder=1)
阅读全文
摘要:import numpy from matplotlib import pyplot x=numpy.linspace(-3,3,50) y=2*x+1 pyplot.figure(num=1,figsize=(5,5)) pyplot.plot(x,y) ax=pyplot.gca() ax.sp
阅读全文
摘要:pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签 pyplot.rcParams['axes.unicode_minus']=False
阅读全文
摘要:import numpy from matplotlib import pyplot x=numpy.linspace(-3,3,50) y1=2*x+1 y2=x**2 pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签 pyplot.rcP
阅读全文
摘要:1 import numpy 2 from matplotlib import pyplot 3 x=numpy.linspace(-3,3,50) 4 y1=2*x+1 5 y2=x**2 6 7 8 pyplot.figure(num='第一幅图',figsize=(5,5)) 9 pyplot
阅读全文
摘要:import numpy from matplotlib import pyplot x=numpy.linspace(-3,3,50) y1=2*x+1 y2=x**2 #创建第一个画布 pyplot.figure() pyplot.plot(x,y1) #创减第二个画布 pyplot.figur
阅读全文
摘要:1 from matplotlib import pyplot 2 import numpy 3 x=numpy.random.randn(100) #生成100个随机数,关于标准正态分布 4 y=-x+numpy.random.randn(100)*0.5 5 pyplot.scatter(x,y
阅读全文

浙公网安备 33010602011771号