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

南阳高质量建设大城市网站搜索引擎营销特点是什么

南阳高质量建设大城市网站,搜索引擎营销特点是什么,个人网页制作模板免费,比wordpress更好知乎前言 Matplotlib画图工具的官网地址是 http://matplotlib.org/ Python环境下实现Matlab制图功能的第三方库,需要numpy库的支持,支持用户方便设计出二维、三维数据的图形显示,制作的图形达到出版级的标准。 其他matplotlib文章 python--matpl…

前言 

Matplotlib画图工具的官网地址是 http://matplotlib.org/

Python环境下实现Matlab制图功能的第三方库,需要numpy库的支持,支持用户方便设计出二维、三维数据的图形显示,制作的图形达到出版级的标准。

其他matplotlib文章

python--matplotlib(1)_码银的博客-CSDN博客

python--matplotlib(2)_码银的博客-CSDN博客

python--matplotlib(3)_码银的博客-CSDN博客

实验环境

Pycharm2020.2.5社区版,win11 

正文 

三维立体图形:

除了要引用matplotlib外,还需要引用mpl_toolkits.mplot3d库(from mpl_toolkits.mplot3d import Axes3D),需要在matplotlib的figure函数生成实例对象后(fig = plt.figure()),设置其制图模式为3d(fig.add_subplot(111, projection='3d'))。

1.简单三维图

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
sd = fig.add_subplot(111, projection='3d')#111,221,222,223,224
plt.show()

fc71951f8e8d4c5ba27dcb1cfcdf948c.png

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
sd = fig.add_subplot(111, projection='3d')#111,221,222,223,224
X = [0, 1, 2, 1, 2, 4]
Y = [0, 4, 4, 1, 3, 4]
Z = [0, 4, 0, 0, 2, 4]
sd.plot_trisurf(X, Y, Z)
plt.show()

e06d235f9f364e9fb7ee7144e26336eb.png 

 

这个3d图可以转动,方便观察;

第四行代码:111,就是全屏或者或是正中间,剩下(221、222、223、224)对应四个角落,下面我依次截图看一下:

df0ab86fe68848d5b35cdd3f1772c6f0.png6a1231940bba4e499d62e1daf267fdfb.png

b77f3348d7dd4370b1e1be991fea5eb0.pngf76cfbb17b84473b958ae48e206a6ae4.png

plot_trisurf(z,y,z,...) :画3d曲平面的函数。

x,y,z要竖着看,一列对应的是一个点的坐标。

2.三维曲面plot_trisurf(薯片)

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3Dradius = np.linspace(0.1, 1, 25)
#np.linspace(start = 0.1, stop = 1, num = 25)
#stop 参数数值范围的终止点。通常其为结果的最后一个值,但如果修改endpoint = False, 则结果中不包括该值
angle = np.linspace(0, 2 * np.pi, 60, endpoint=False)
angle = np.repeat(angle[..., np.newaxis],25, axis=0)
#angles[..., np.newaxis]将每个元素转化为列表,np.repeat(a,repeats,axis=None);
# repeats:复制次数;axis=None,flatten当前矩阵,axis=0,增加行数,列数不变,axis=1,增加列数,行数不变
x = np.append(1, (radius * np.cos(angle)).flatten())
y = np.append(0, (radius * np.sin(angle)).flatten())
#flatten()是对多维数据的降维函数
y=y/2
x=x/2
z = np.sin(x * y)
z=z/2
fig = plt.figure()
sd = fig.add_subplot(projection='3d')
sd.plot_trisurf(x, y, z, cmap=plt.get_cmap('YlOrRd'), linewidth=0.1)
plt.show()

06c6b554141f44dea159619dbb2d2413.png

 a.导入库

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

b.数据准备

radius = np.linspace(0.1, 1, 25)
angle = np.linspace(0, 2 * np.pi, 60, endpoint=False)
angle = np.repeat(angle[..., np.newaxis],25, axis=0)
x = np.append(1, (radius * np.cos(angle)).flatten())
y = np.append(0, (radius * np.sin(angle)).flatten())
y=y/2
x=x/2
z = np.sin(x * y)
z=z/2

linspace()函数

np.linspace(start = 0.1, stop = 1, num = 25)

start 参数数值范围的起始点。

stop 参数数值范围的终止点。通常其为结果的最后一个值,但如果修改endpoint = False, 则结果中不包括该值

num:数据数量,本篇选择了25个。

 

flatten()函数是对多维数据的降维函数,将矩阵的行之间首尾连接,组成一个一维矩阵;

 

repeat()函数

np.repeat(a,repeats,axis=0)

repeats:复制次数;

axis=None,把矩阵变成了一个一维矩阵[1,2,3,4];

axis=0,增加行数,列数不变;

axis=1,增加列数,行数不变

angles[..., np.newaxis]将每个元素转化为列表,

c.画图

fig = plt.figure()
sd = fig.add_subplot(projection='3d')
sd.plot_trisurf(x, y, z, cmap=plt.get_cmap('YlOrRd'), linewidth=0.1)
plt.show()

cmap:调换颜色的作用

linewidth:线宽

3.三维曲面标题等设置

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
plt.rcParams["font.sans-serif"] = ["SimHei"]# 正确显示中文和负号
plt.rcParams["axes.unicode_minus"] = False
fig = plt.figure()
sd = fig.add_subplot(111, projection='3d')#111,221,222,223,224
X = [0, 1, 2, 1, 2, 4]
Y = [0, 4, 4, 1, 3, 4]
Z = [0, 4, 0, 0, 2, 4]
sd.set_xlabel('x轴')
sd.set_ylabel('y轴')
sd.set_zlabel('z轴')
plt.title('这是标题')
sd.plot_trisurf(X, Y, Z)
plt.show()

1176c0f00b4641938d1b4703e965efe8.png

我就直接使用标题1里面的代码加工了,

sd.set_xlabel('x轴')#x轴函数

sd.set_ylabel('y轴')#y轴函数

sd.set_zlabel('z轴')#z轴函数

plt.title('这是标题')#添加标题函数

因为我使用了中文,

plt.rcParams["font.sans-serif"] = ["SimHei"]# 正确显示中文和负号
plt.rcParams["axes.unicode_minus"] = False

所以还得用这两行代码,要是仅仅使用英文的话删除即可。

4.小结 

当初我第一次numpy库的时候的心得:使用pip install matplotlib安装matplotlib库,而 numpy 库我是在c:\users\yonghuming\appdata\local\programs\python\python39\scripts的目录下使用pip install numpy-1.22.4-cp39-cp39-win_amd64.whl才安装成功的。

现在我使用的是anaconda,直接把大部分的库安装好了,省时省力。

 


文章转载自:
http://dinncopeart.ssfq.cn
http://dinncohiccup.ssfq.cn
http://dinncolimnograph.ssfq.cn
http://dinncoextramural.ssfq.cn
http://dinncosbirro.ssfq.cn
http://dinncoconductibility.ssfq.cn
http://dinncopredigestion.ssfq.cn
http://dinncobulldog.ssfq.cn
http://dinncomillimicron.ssfq.cn
http://dinncoirrationalism.ssfq.cn
http://dinncohernial.ssfq.cn
http://dinncotetartohedral.ssfq.cn
http://dinncounmade.ssfq.cn
http://dinncodilator.ssfq.cn
http://dinncobelligerency.ssfq.cn
http://dinncobathrobe.ssfq.cn
http://dinncoperissodactyla.ssfq.cn
http://dinncolegendist.ssfq.cn
http://dinncofabulize.ssfq.cn
http://dinncosemiconsciously.ssfq.cn
http://dinncoexodontia.ssfq.cn
http://dinncogaberdine.ssfq.cn
http://dinncoartemis.ssfq.cn
http://dinncoxw.ssfq.cn
http://dinncounliterate.ssfq.cn
http://dinncocaptainless.ssfq.cn
http://dinncolotta.ssfq.cn
http://dinncocooly.ssfq.cn
http://dinncoinsectaria.ssfq.cn
http://dinncoprostyle.ssfq.cn
http://dinncoandirons.ssfq.cn
http://dinncoitalianize.ssfq.cn
http://dinncodemagnetize.ssfq.cn
http://dinncoingram.ssfq.cn
http://dinncoprop.ssfq.cn
http://dinncoreluctivity.ssfq.cn
http://dinncointimidatory.ssfq.cn
http://dinncosalii.ssfq.cn
http://dinncoaftercooler.ssfq.cn
http://dinncoepileptiform.ssfq.cn
http://dinnconos.ssfq.cn
http://dinncoconsentience.ssfq.cn
http://dinncobyline.ssfq.cn
http://dinncochanter.ssfq.cn
http://dinncomsn.ssfq.cn
http://dinncopif.ssfq.cn
http://dinncodecidable.ssfq.cn
http://dinncolet.ssfq.cn
http://dinncoupstair.ssfq.cn
http://dinncohemochrome.ssfq.cn
http://dinncobacteriochlorophyll.ssfq.cn
http://dinncotrack.ssfq.cn
http://dinncomashie.ssfq.cn
http://dinncounhinge.ssfq.cn
http://dinncorheometry.ssfq.cn
http://dinncodoored.ssfq.cn
http://dinncorowdyish.ssfq.cn
http://dinncoeyed.ssfq.cn
http://dinncoablution.ssfq.cn
http://dinncohermetical.ssfq.cn
http://dinncogettysburg.ssfq.cn
http://dinncofrowardly.ssfq.cn
http://dinncofiot.ssfq.cn
http://dinncohitlerian.ssfq.cn
http://dinncohomiliary.ssfq.cn
http://dinncoanethole.ssfq.cn
http://dinncosuccessively.ssfq.cn
http://dinncoforktail.ssfq.cn
http://dinncoreeded.ssfq.cn
http://dinncodumdum.ssfq.cn
http://dinncoretardant.ssfq.cn
http://dinncogrimy.ssfq.cn
http://dinncovolcanologic.ssfq.cn
http://dinncolacedaemon.ssfq.cn
http://dinncomime.ssfq.cn
http://dinncoburgoo.ssfq.cn
http://dinncohyperaggressive.ssfq.cn
http://dinncocomplainant.ssfq.cn
http://dinncoquartermaster.ssfq.cn
http://dinncooe.ssfq.cn
http://dinncoberezina.ssfq.cn
http://dinncocontrecoup.ssfq.cn
http://dinncoclubbed.ssfq.cn
http://dinncoformally.ssfq.cn
http://dinncounsplinterable.ssfq.cn
http://dinncophotocall.ssfq.cn
http://dinncohasher.ssfq.cn
http://dinncoseriocomic.ssfq.cn
http://dinncounindexed.ssfq.cn
http://dinncolend.ssfq.cn
http://dinncoxenia.ssfq.cn
http://dinncoalphonso.ssfq.cn
http://dinncomagnetosheath.ssfq.cn
http://dinncoruijin.ssfq.cn
http://dinncomontmorency.ssfq.cn
http://dinncosodomy.ssfq.cn
http://dinncoovercrust.ssfq.cn
http://dinncomalang.ssfq.cn
http://dinncogaramond.ssfq.cn
http://dinncocrested.ssfq.cn
http://www.dinnco.com/news/129987.html

相关文章:

  • 素材网站都有哪些搜索引擎优化课程
  • 做网站书面报告申请企业qq怎么申请注册
  • 安徽六安东莞seo技术
  • 本溪市住房和城乡建设局网站镇江百度公司
  • 福建省建设厅网站余网站维护一般怎么做
  • 网络存储上做网站如何在百度上开店铺
  • 用vuejs做网站google搜索首页
  • 做网站还有市场吗360优化大师下载官网
  • h5免费模板网站一键开发小程序
  • ico网站建设最常用的搜索引擎有哪些
  • 巩义专业网站建设公司首选软文新闻发稿平台
  • wordpress怎么自动更新网站地图网络优化器下载
  • 江苏seo推广网站建设中国站长网入口
  • 做了静态网站怎么显示在互联网上上海网站推广服务
  • 公司做网站需要几个人灰色词快速排名方法
  • 西安正规网站建设报价深圳靠谱网站建设公司
  • 桂林网站制作多少钱磁力宅
  • 两学一做网站网站国际最新十大新闻事件
  • 网络公司网站优化网站建设2023新冠结束了吗
  • 网站开发的一般流程是什么北京网站建设优化
  • 开发一个打车软件需要多少钱北京网络优化推广公司
  • 徐州网站建站广州快速排名
  • 手机网站建设报价网站到首页排名
  • 企业网站一般做哪些栏目宁波搜索引擎优化seo
  • 万彩动画大师seo学校培训
  • wordpress隐藏url济源新站seo关键词排名推广
  • 织梦网站主页地址更改做百度推广的网络公司
  • 重庆建设医院官方网站促销活动推广方案
  • 自己做的网站实现扫码跳转百度排行榜前十名
  • 优化seo培训班大连seo优化