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

怎样免费设计网站建设联想电脑网站建设策划书

怎样免费设计网站建设,联想电脑网站建设策划书,利用代码如何做网站,商丘市建设本文只介绍最简单基本的画图方法 预设 要想画出来的图有些逼格#xff0c;首先应该进行如下设置 plt.rcParams[font.sans-serif][SimHei] #画图时显示中文字体 plt.rcParams[axes.unicode_minus] False #防止因修改成中文字符#xff0c;导致某些 unicode 字符不能…本文只介绍最简单基本的画图方法 预设 要想画出来的图有些逼格首先应该进行如下设置 plt.rcParams[font.sans-serif][SimHei] #画图时显示中文字体 plt.rcParams[axes.unicode_minus] False #防止因修改成中文字符导致某些 unicode 字符不能显示 plt.subplots_adjust(leftNone, bottomNone, rightNone, topNone,wspace0.3) #设置制子图之间的左右间距left 等是设置画图区域与画布之间的间font1 {family : SimHei, weight : normal, size : 15, } #设置图例legend文字的格式的绘制多幅图 基本格式 fig plt.figure(figsize()) ax1 plt.subplot(m,n,1) #m 为行、n为列、1 为图序 plt.plot(xxxxx)ax2 plt.subplot(m,n,2) plt.plot(xxxx)...... 示例如下 python import matplotlib.pyplot as plt import numpy as np x np.linspace(0,2*np.pi,100) y1 np.sin(x) y2 np.cos(x) y3 x1fig plt.figure(figsize(12,4)) #宽度、高度 ax1 plt.subplot(1,3,1) plt.plot(x,y1,linewidth1.5,colorc,labelr$y_1$,markero,markersize4) plt.xlabel(x,fontsize24) plt.ylabel(r$y_1$,fontsize24) plt.ylim([-1,1]) plt.xlim([0,2*np.pi]) plt.legend(propfont1,locbest) plt.grid()ax2 plt.subplot(1,3,2) plt.plot(x,y2,linewidth3,colorr,labelr$y_2$,linestyle-.) plt.xlabel(x,fontsize24) plt.ylabel(r$y_2$,fontsize24) plt.ylim([-1,1]) plt.xlim([0,2*np.pi]) plt.legend(propfont1,locbest) plt.grid()ax3 plt.subplot(1,3,3) plt.plot(x,y3,linewidth1.5,colorb,labelr$y_3$,linestyle--) plt.xlabel(x,fontsize24) plt.ylabel(r$y_3$,fontsize24) plt.legend(propfont1,locbest) plt.grid()另外。plt.title 也可以设图片的标题子图的标题也行 画骨骼图 先看效果 这里要用 axe 来画图而不能直接用 plt代码如下 def sigmoid(x):return 1./(1.np.exp(-x))def relu(x):return np.where(x0,0,x)def tanh(x):return 2*sigmoid(2*x)-1font1 {family : Times New Roman, weight : normal, size : 14, }def plot_tran_fun(): plt.rcParams[font.sans-serif][SimHei]plt.rcParams[axes.unicode_minus] Falsefig plt.figure(figsize(8,6))ax1 plt.subplot(2,2,1)x np.arange(-10, 10)y sigmoid(x)ax.spines[top].set_color(none)ax.spines[right].set_color(none)ax.xaxis.set_ticks_position(bottom)ax.spines[bottom].set_position((data,0))ax.set_xticks([-10,-5,0,5,10])ax.yaxis.set_ticks_position(left)ax.spines[left].set_position((data,0))ax.plot(x,y,labelSigmoid,color blue)plt.legend(propfont1,loclower right) # plt.show() # # ax2 plt.subplot(2,2,2)x np.arange(-10, 10)y tanh(x)ax.spines[top].set_color(none)ax.spines[right].set_color(none)ax.xaxis.set_ticks_position(bottom)ax.spines[bottom].set_position((data,0))ax.set_xticks([-10,-5,0,5,10])ax.yaxis.set_ticks_position(left)ax.spines[left].set_position((data,0))ax.plot(x,y,labelTanh,color blue)plt.legend(propfont1) # ax.show() # ax fig.add_subplot(223) # x np.arange(-10, 10)y relu(x)ax.spines[top].set_color(none)ax.spines[right].set_color(none)ax.xaxis.set_ticks_position(bottom)ax.spines[bottom].set_position((data,0))ax.set_xticks([-10,-5,0,5,10])ax.yaxis.set_ticks_position(left)ax.spines[left].set_position((data,0))ax.plot(x,y,labelReLU,color blue)plt.legend(propfont1) # ax fig.add_subplot(224) # x np.arange(-10, 10)y xax.spines[top].set_color(none)ax.spines[right].set_color(none)ax.xaxis.set_ticks_position(bottom)ax.spines[bottom].set_position((data,0))ax.set_xticks([-10,-5,0,5,10])ax.yaxis.set_ticks_position(left)ax.spines[left].set_position((data,0))ax.plot(x,y,labelLinear,color blue)plt.legend(propfont1)plot_tran_fun()其他画图 画出包围部分 一般用在画积分面积的时候代码如下 fig plt.figure(figsize(6,4)) plt.plot(x,y1,x,y2) plt.fill_between(x,y1,y2,facecolork,alpha0.2) plt.text(1.5,0,包围部分,fontsize20) plt.title(画出包围部分,fontsize16)散点图 plt.scatter(x,y,sNone,cNone,markerNone,alphaNone) 其中 s 为每一个点的大小若传入的是一个列表或者 array则array匹配每一个点的大小 c 表示点的颜色若传入的是列表或者 array则匹配每一个点的颜色 from sklearn.datasets import make_gaussian_quantiles X, y make_gaussian_quantiles(n_samples300,n_features2, n_classes2) #产生数据集 X0 X[y.ravel()0] plt.scatter(X0[:, 0], X0[:, 1], markero) X1 X[y.ravel()1] plt.scatter(X1[:, 0], X1[:, 1], markerx) 柱状图 plt.bar(x,height,width,color) 其中 height 是柱状图的高度即 y x np.arange(10) y1 np.random.randn(10) y2 np.random.randn(10) fig plt.figure(figsize(6,4)) plt.bar(x,y1,width0.35,colorg) plt.bar(x0.35,y2,width0.35,colorb) plt.xlabel(x,fontsize16) plt.ylabel(y,fontsize16)饼状图 plt.pie(x,labelsNone,explodeNone,colorsNone,autopctNone) 其中x 为待表示数据label 接受一个 array分别对应 x 的标签explode 接受 array表示饼状图离圆心的距离用半径的百分比表示colors 可以接受 array表示每一个饼的颜色autopct 是设置比例的表示方法如 %1.1f %%第二个 % 是为了转意 x [15,20,30,40] explode [0.05]*len(x) autopct %1.1f %% labels [one,two,three,four] fig plt.figure(figsize(6,4)) patches,l_text,p_text plt.pie(x,labelslabels,explodeexplode,autopctautopct) #l_text,p_text 是为了设置饼状图的文本。l_text 是labels的文本p_text 是图内部的文本比例 for t in l_text:t.set_size(30) for t in p_text:t.set_size(20)箱型图 plt.boxplot(df,sym,meanline) df为箱型图绘制的数据以列为单位进行绘制 sym为异常点的形状 meanline是否展示平均线 import pandas as pd df pd.DataFrame(np.random.randn(5,4),columns[A,B,C,D]) fig plt.figure(figsize(6,4)) plt.boxplot(df,symo,meanlineTrue)若要设置 xticks则需要用到 ax如下 df pd.DataFrame(np.random.randn(5,4),columns[A,B,C,D]) fig plt.figure(figsize(6,4)) ax plt.subplot()ax.boxplot(df,symo) ax.set_xticklabels([A,B,C,D]) 频率直方图 import pandas as pd x np.random.normal(0,1,size(100)) fig plt.figure(figsize(6,4)) bin_num 10 plt.hist(x,bin_num)
http://www.sczhlp.com/news/159239/

相关文章:

  • seo公司网站云开发cms内容管理系统
  • ppt做会动彩字网站天翼云服务器
  • 做公司网站需不需要注册自学做网站多久
  • 永康城乡建设局网站做外贸公司 网站
  • 学做网站好做吗电商网站开发设计
  • 各大网站网址网上商店的特点
  • 国家高新技术企业名单东莞网站快速优化排名
  • 佛山网页网站设计多少钱制作企业网站素材视频
  • 畜牧业网站模板wordpress手机号码登录
  • 手机微信一体网站建设微信管理系统登录入口
  • 京东网站开发技术百度站长工具对seo的帮助
  • 做视频赚钱的国外网站网站建设面包屑导航条
  • 先做网站还是先做天猫用python怎么做网站
  • 做淘宝网站如何提取中间的提成网站功能需求怎么写
  • 河南微网站建设公司金山郑州阳网站建设
  • 威海建设集团官方网站外贸网站哪家好
  • 网站建设轮播图做环保工程常用的网站
  • 如何在手机上做微电影网站网络营销的概念及特征
  • wordpress站点地图样式河北pc端网站建设
  • 在线学做网站wordpress mysql 数据库
  • 查做外贸客户的网站地情网站建设
  • 哪个网站帮别人做ppt做个公司网页一般需要多少钱
  • 简述一个网站开发流程泛搜索wordpress
  • 菏泽市住房和城乡建设局网站手机网站横向切换
  • 西北舜天建设有限公司网站wordpress内存缓存插件
  • 昆明有网站的公司附子seo
  • seo排名优化网站铜陵网站制作
  • 个体户怎么做购物网站天津seo优化排名
  • 用asp做的网站打开页面很慢wordpress打分免插件
  • 大鹏网络网站建设报价封开网站建设公司