当前位置: 首页 > news >正文

做php网站的环境百度高级搜索页面

做php网站的环境,百度高级搜索页面,潍坊手机网站建设,网站聚合页Matplotlib是python的一个画图库#xff0c;便于数据可视化。 安装命令 pip install matplotlib 常用命令#xff1a; 绘制直线#xff0c;连接两个点 import matplotlib.pyplot as plt plt.plot([0,5],[2,4]) plt.show() 运行结果如下#xff1a; 多条线#xff1a;…Matplotlib是python的一个画图库便于数据可视化。 安装命令 pip install matplotlib 常用命令 绘制直线连接两个点 import matplotlib.pyplot as plt plt.plot([0,5],[2,4]) plt.show() 运行结果如下 多条线 import numpy as np import matplotlib.pyplot as plt xnp.linspace(0,10,100) plt.plot(x,x0,--g,label--g) plt.plot(x,x1,-.r,label-.r) plt.plot(x,x2,:b,label:b) plt.plot(x,x4,.k,label.k) plt.plot(x,x5,*m,label*m) plt.legend(locupper left,fancyboxTrue,framealpha1,shadowTrue,borderpad1)#图例位置默认左上角,lower right右下角 plt.show() 绘制折线 import matplotlib.pyplot as plt x [1, 2, 3, 4, 5, 6] y [] for i in range(0, len(x)):y.append(x[i] ** 2) print() plt.plot(x,y) plt.show() 运行结果如下 设置样式 import matplotlib.pyplot as plt x [1, 2, 3, 4, 5, 6] y [] for i in range(0, len(x)):y.append(x[i] ** 2) print() plt.plot(x,y,linewidth5) plt.rcParams[font.sans-serif][SimHei] plt.xlabel(X) plt.ylabel(X的平方) plt.title(折线图绘制) plt.show() 绘制曲线 import numpy as np import matplotlib.pyplot as plt xnp.linspace(0,10,100) sin_ynp.sin(x) cos_ynp.cos(x) plt.plot(x,sin_y) plt.plot(x,cos_y) plt.show() 分区 plt.subplot(1,2,1) plt.plot(x,sin_y) plt.subplot(1,2,2) plt.plot(x,cos_y) plt.show() 绘制散点图 import numpy as np import matplotlib.pyplot as plt np.random.seed(0) xnp.random.rand(100) ynp.random.rand(100) #10size sizenp.random.rand(100)*1000 #100color colornp.random.rand(100) plt.scatter(x,y,ssize,ccolor,alpha0.7)#alpha透明度 plt.show() 运行结果如下 条形图 import numpy as np import matplotlib.pyplot as plt plt.rcParams[font.sans-serif][SimHei] x[1995,2000,2005,2010,2015,2020] x_label[1995年,2000年,2005年,2010年,2015年,2020年] y[100,200,300,400,300,200] plt.bar(x,y,width3) plt.xticks(x,x_label) plt.xlabel(年份) plt.ylabel(销量) plt.show() 横向的条形图 import numpy as np import matplotlib.pyplot as plt np.random.seed(0) xnp.arange(6) ynp.random.randint(-5,5,6) v_barplt.barh(x,y,colorblue) for bar,height in zip(v_bar,y):if height0:bar.set(colorgreen) plt.axvline(0) plt.show() 柱状图组合 import numpy as np import matplotlib.pyplot as plt plt.rcParams[font.sans-serif][SimHei] real_names[熊大,熊二,熊三] real_num1[7548,4013,1673] real_num2[5453,3840,1980] real_num3[1348,2345,1890] xnp.arange(len(real_names)) width0.3 plt.bar(x,real_num1,alpha0.5,widthwidth,labelreal_names[0]) plt.bar([iwidth for i in x],real_num2,alpha0.5,widthwidth,labelreal_names[1]) plt.bar([i2*width for i in x],real_num3,alpha0.5,widthwidth,labelreal_names[2]) x_label[第{}天.format(i1) for i in x] plt.xticks([iwidth for i in x],x_label) plt.title(柱状图组合) plt.ylabel(数量) plt.legend() plt.show() 绘制直方图 import numpy as np import matplotlib.pyplot as plt xnp.random.normal(0,1,1000) ynp.random.normal(-2,1,1000) znp.random.normal(3,2,1000) kwargsdict(bins100,alpha0.5) plt.hist(x,**kwargs) plt.hist(y,**kwargs) plt.hist(z,**kwargs) plt.show() 饼图 import matplotlib.pyplot as plt plt.rcParams[font.sans-serif][SimHei] values [15, 30, 45, 10] total sum(values) sizes [v / total for v in values] labels [类别1, 类别2, 类别3, 类别4] fig, ax plt.subplots() ax.pie(sizes, labelslabels, autopct%1.1f%%, startangle90) ax.axis(equal) plt.show() 等高线图 import numpy as np import matplotlib.pyplot as plt xnp.linspace(-10,10,100) ynp.linspace(-10,10,100) X,Ynp.meshgrid(x,y) Znp.sqrt(X**2Y**2) plt.contourf(X,Y,Z) #plt.contour(X,Y,Z) #不填充的 plt.show() 三维图形 import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D X[1,1,2,2] Y[3,4,4,3] Z[1,100,1,1] triangles [[0, 1, 2]] fig plt.figure() ax fig.add_subplot(111, projection3d) ax.plot_trisurf(X, Y, Z, trianglestriangles, cmapviridis) plt.show()
http://www.dnsts.com.cn/news/40217.html

相关文章:

  • 十大免费自媒体素材网站手机网站推荐大全
  • 网站类产品怎么做竞品分析哈尔滨建设网证照查询
  • 宠物交易网站开发免费网站建站百度云
  • 阿里做网站在本地做的网站怎么修改域名
  • 河南网站建设官网redis 移动 wordpress
  • 记事本做网站怎么改字体wordpress 5.0火车头发布模块
  • 怎么在京东做网站建筑公司企业资料
  • 三网合一网站源代码开发一整个网站要多久
  • 响应式网站怎么做才实用成都市住房和城乡建设局网站
  • 无锡建设公司网站热卖平台网站怎么做
  • wordpress导航怎么添加连接优化软件
  • 高校网站建设资料库电子商务网页制作是什么
  • 做调查问卷的网站有什么温州网站建设报价
  • 免费软件app下载大全正能量网站网站开发作用
  • 网站收录了被人为删了怎么办深圳网站系统哪家强
  • 找网站公司做网站天津网站大全
  • 西安做企业网站邳州建网站
  • 思维导图在线制作网站小破站下载
  • 免费微网站_自助建站c 做网站
  • 上海网站建设开百度快照 网站描述 更新
  • 网站建设的组织结构wordpress建立网盘
  • 专业网站建设公司哪里济南兴田德润什么活动wordpress技术论坛
  • 网站需要维护自适应h5网页模板
  • 性价比最高网站建设价格承接网站怎么做
  • 做业务查牙医诊所一般用什么网站wordpress建网站知乎
  • 绵阳专门做网站的公司广州网站建设 致茂
  • 佛山网站设计特色三亚 网站建设
  • 健身房网站建设案例烟台企业管理培训课程
  • 一个网站有多少网页排名好的网站关键词优化企业
  • 做网站开发语言硅云wordpress