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

matplotlib绘制三维图

目录

      • 线状堆积图 PolygonPlot
      • 三维表面图 SurfacePlot
      • 散点图ScatterPlot
      • 柱形图 BarPlot
      • 三维直方图
      • 螺旋曲线图 LinePlot
      • ContourPlot
      • 轮廓图
      • 网状图 WireframePlot
      • 箭头图
      • 二维三维合并
      • 文本图Text
      • 三维多个子图

线状堆积图 PolygonPlot

Axes3D.add_collection3d(col, zs=0, zdir=‘z’)
   这个函数可以将三维 collection对象或二维collection对象加入到一个图形中,包括:

  • PolyCollection
  • LineCollection
  • PatchCollection
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
import numpy as np
plt.rcParams['font.family'] = 'Microsoft YaHei' # 字体设置
plt.rcParams['font.size'] = 10 # 字体大小设置fig = plt.figure(figsize=(30,20))
ax = fig.gca(projection='3d')def cc(arg):return mcolors.to_rgba(arg, alpha=0.6)
def polygon_under_graph(xlist, ylist):'''Construct the vertex list which defines the polygon filling the space underthe (xlist, ylist) line graph.  Assumes the xs are in ascending order.'''return [(xlist[0], 0.), *zip(xlist, ylist), (xlist[-1], 0.)]xs = np.arange(0,137,1)verts = []zs = [0.0,1.0,2.0, 3.0,4.0]
for z in zs:for i in range(1,6):   #读取数据ys = df.iloc[:,i]verts.append(polygon_under_graph(xs,ys))poly = PolyCollection(verts, facecolors=[cc('r'), cc('g'), cc('b'),cc('y'),cc('r')])
poly.set_alpha(0.7)  # 图形的透明度
ax.add_collection3d(poly, zs=zs, zdir='y')names_1 = ['2022-10-18', '2022-10-19', '2022-10-20','2022-10-21',
'2022-10-22', '2022-10-23']
plt.xticks(xs[::24], names_1)names = ['北京', '石家庄', '保定','唐山','廊坊']
plt.yticks(zs, names)ax.set_xlabel('时间')
ax.set_ylabel('城市')
ax.set_zlabel('AQI')
ax.set_xlim3d(0, 136)
ax.set_ylim3d(-1, 5)
ax.set_zlim3d(0, 130)
#plt.savefig('三维时间.png',bbox_inches = 'tight',dpi=500)
plt.show()

在这里插入图片描述

三维表面图 SurfacePlot

Axes3D.plot_surface(X, Y, Z, *args, norm=None, vmin=None, vmax=None, lightsource=None, **kwargs)

这个函数算是比较常用的函数,用于绘制三维表面图,让人惊艳的是它的着色效果。

ArgumentDescription
X, Y,Z坐标点
rcount,ccount,rstride,cstride同上
color定义surface patch的颜色,type:color-like
cmap定义surface patch的颜色,只不过是colorMap,type:colormap
facecolors指定单个patch的颜色, type:array-like of colors
normcolormap的normalization, type:Normalize
shade阴影效果,type:boolean
vmin, vmaxnormalization的边界
**kwargs向下传递到Poly3DCollection
antialiased抗锯齿,type:boolean
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cmfrom matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as npfig = plt.figure(figsize=(30,10))
ax = fig.gca(projection='3d')# Make data.
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)# Plot the surface.
surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm,linewidth=0, antialiased=False)# Customize the z axis.
ax.set_zlim(-1.01, 1.01)
ax.zaxis.set_major_locator(LinearLocator(10))
ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))# Add a color bar which maps values to colors.
fig.colorbar(surf, shrink=0.5, aspect=5)plt.show()

在这里插入图片描述

散点图ScatterPlot

Axes3D.scatter(xs, ys, zs=0, zdir=‘z’, s=20, c=None, depthshade=True, *args, **kwargs)

返回Patch3DCollection,

其他参数向下传递给plot函数

ArgumentDescription
xs, ysx,y坐标点
zsz 坐标,可以是一个标量或一个x*y维矩阵,默认是0.
zdir当绘制二维图像时的z轴方向
ssize,即散点大小
c颜色映射,其取值可以是非常多类型,有时间专门写一篇讲解
depthshade是否渲染景深(或则就说阴影吧),默认是True.
from mpl_toolkits.mplot3d import Axes3Dimport matplotlib.pyplot as plt
import numpy as np# Fixing random state for reproducibility
np.random.seed(19680801)def randrange(n, vmin, vmax):'''Helper function to make an array of random numbers having shape (n, )with each number distributed Uniform(vmin, vmax).'''return (vmax - vmin)*np.random.rand(n) + vminfig = plt.figure(figsize=(20,10))
ax = fig.add_subplot(111, projection='3d')n = 100# For each set of style and range settings, plot n random points in the box
# defined by x in [23, 32], y in [0, 100], z in [zlow, zhigh].
for c, m, zlow, zhigh in [('r', 'o', -50, -25), ('b', '^', -30, -5)]:xs = randrange(n, 23, 32)ys = randrange(n, 0, 100)zs = randrange(n, zlow, zhigh)ax.scatter(xs, ys, zs, c=c, marker=m)ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')plt.show()

在这里插入图片描述

柱形图 BarPlot

Axes3D.bar(left, height, zs=0, zdir=‘z’, *args, **kwargs)

其他参数向下传递给bar函数,返回Patch3DCollection对象

ArgumentDescription
left条形图水平坐标
height条形的高度
zsZ方向
zdir同上
from mpl_toolkits.mplot3d import Axes3D  # noqa: F401 unused importimport matplotlib.pyplot as plt
import numpy as np# Fixing random state for reproducibility
np.random.seed(19680801)fig = plt.figure(figsize=(10,20))
ax = fig.add_subplot(111, projection='3d')colors = ['r', 'g', 'b', 'y']
yticks = [3, 2, 1, 0]
for c, k in zip(colors, yticks):# Generate the random data for the y=k 'layer'.xs = np.arange(20)ys = np.random.rand(20)# You can provide either a single color or an array with the same length as# xs and ys. To demonstrate this, we color the first bar of each set cyan.cs = [c] * len(xs)# Plot the bar graph given by xs and ys on the plane y=k with 80% opacity.ax.bar(xs, ys, zs=k, zdir='y', color=cs, alpha=0.8)ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')# On the y axis let's only label the discrete values that we have data for.
ax.set_yticks(yticks)plt.show()

在这里插入图片描述

三维直方图

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as npfig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x, y = np.random.rand(2, 100) * 4
hist, xedges, yedges = np.histogram2d(x, y, bins=4, range=[[0, 4], [0, 4]])# Construct arrays for the anchor positions of the 16 bars.
# Note: np.meshgrid gives arrays in (ny, nx) so we use 'F' to flatten xpos,
# ypos in column-major order. For numpy >= 1.7, we could instead call meshgrid
# with indexing='ij'.
xpos, ypos = np.meshgrid(xedges[:-1] + 0.25, yedges[:-1] + 0.25)
xpos = xpos.flatten('F')
ypos = ypos.flatten('F')
zpos = np.zeros_like(xpos)# Construct arrays with the dimensions for the 16 bars.
dx = 0.5 * np.ones_like(zpos)
dy = dx.copy()
dz = hist.flatten()ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b', zsort='average')plt.show()

在这里插入图片描述

螺旋曲线图 LinePlot

Axes3D.plot(xs, ys, *args, zdir=‘z’, **kwargs)

其他参数向下传递给plot函数

ArgumentDescription
xs, ysx、y 坐标
zsz 坐标,可以是一个标量或一个x*y维矩阵
zdir当绘制二维图像时的z轴方向
from mpl_toolkits.mplot3d import Axes3Dimport numpy as np
import matplotlib.pyplot as pltplt.rcParams['legend.fontsize'] = 10
fig = plt.figure(figsize=(10,20))
ax = fig.gca(projection='3d')  # get current axes# Prepare arrays x, y, z
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)ax.plot(x, y, z, label='parametric curve')
ax.legend()  plt.show()

在这里插入图片描述

ContourPlot

Axes3D.contour(X, Y, Z, *args, extend3d=False, stride=5, zdir=‘z’, offset=None, **kwargs)

ArgumentDescription
X, Y,ZData values as numpy.arrays
extend3d是否延申到3d空间 (default: False)
*stride(extend3d的)采样步长
zdir同上
offset绘制轮廓线在zdir垂直的水平面上的投影
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import cmfig = plt.figure(figsize=(30,10))
ax = fig.gca(projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)# Plot contour curves
cset = ax.contour(X, Y, Z, cmap=cm.coolwarm)ax.clabel(cset, fontsize=9, inline=1)  # function to label a contourplt.show()

在这里插入图片描述

轮廓图


from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import cmfig = plt.figure()
ax = fig.gca(projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)
cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)ax.set_xlabel('X')
ax.set_xlim(-40, 40)
ax.set_ylabel('Y')
ax.set_ylim(-40, 40)
ax.set_zlabel('Z')
ax.set_zlim(-100, 100)plt.show()

在这里插入图片描述

网状图 WireframePlot

Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

ArgumentDescription
X, Y,Z坐标点
rcount,ccount采样数,越大采样越多,默认50
rstride,cstride采样步长,越小采样越多
**kwargs其他参数向下传入Line3DCollection
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as pltfig = plt.figure(figsize=(30,10))
ax = fig.add_subplot(111, projection='3d')# Grab some test data.
X, Y, Z = axes3d.get_test_data(0.05)# Plot a basic wireframe.
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)plt.show()

在这里插入图片描述

箭头图

Axes3D.quiver(*args, **kwargs)

ArgumentDescription
X, Y, ZThe x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
U, V, WThe x, y and z components of the arrow vectors
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as npfig = plt.figure()
ax = fig.gca(projection='3d')# Make the grid
x, y, z = np.meshgrid(np.arange(-0.8, 1, 0.2),np.arange(-0.8, 1, 0.2),np.arange(-0.8, 1, 0.8))# Make the direction data for the arrows
u = np.sin(np.pi * x) * np.cos(np.pi * y) * np.cos(np.pi * z)
v = -np.cos(np.pi * x) * np.sin(np.pi * y) * np.cos(np.pi * z)
w = (np.sqrt(2.0 / 3.0) * np.cos(np.pi * x) * np.cos(np.pi * y) *np.sin(np.pi * z))ax.quiver(x, y, z, u, v, w, length=0.1, normalize=True)plt.show()

在这里插入图片描述

二维三维合并

from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as pltfig = plt.figure()
ax = fig.gca(projection='3d')# Plot a sin curve using the x and y axes.
x = np.linspace(0, 1, 100)
y = np.sin(x * 2 * np.pi) / 2 + 0.5
ax.plot(x, y, zs=0, zdir='z', label='curve in (x,y)')# Plot scatterplot data (20 2D points per colour) on the x and z axes.
colors = ('r', 'g', 'b', 'k')
x = np.random.sample(20 * len(colors))
y = np.random.sample(20 * len(colors))
labels = np.random.randint(3, size=80)# By using zdir='y', the y value of these points is fixed to the zs value 0
# and the (x,y) points are plotted on the x and z axes.
ax.scatter(x, y, zs=0, zdir='y', c=labels, label='points in (x,z)')# Make legend, set axes limits and labels
ax.legend()
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
ax.set_zlim(0, 1)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')# Customize the view angle so it's easier to see that the scatter points lie
# on the plane y=0
ax.view_init(elev=20., azim=-35)plt.show()

在这里插入图片描述

文本图Text

Axes3D.text(x, y, z, s, zdir=None, **kwargs)

text的内容其实也很繁杂,需要用一篇内容去探讨,在三维中很重要的一点是要学会二维、三维文字的添加。

from mpl_toolkits.mplot3d import Axes3D  # noqa: F401 unused importimport matplotlib.pyplot as pltfig = plt.figure()
ax = fig.gca(projection='3d')# Demo 1: zdir
zdirs = (None, 'x', 'y', 'z', (1, 1, 0), (1, 1, 1))
xs = (1, 4, 4, 9, 4, 1)
ys = (2, 5, 8, 10, 1, 2)
zs = (10, 3, 8, 9, 1, 8)for zdir, x, y, z in zip(zdirs, xs, ys, zs):label = '(%d, %d, %d), dir=%s' % (x, y, z, zdir)ax.text(x, y, z, label, zdir)# Demo 2: color
ax.text(9, 0, 0, "red", color='red')# Demo 3: text2D
# Placement 0, 0 would be the bottom left, 1, 1 would be the top right.
ax.text2D(0.05, 0.95, "2D Text", transform=ax.transAxes)# Tweaking display region and labels
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
ax.set_zlim(0, 10)
ax.set_xlabel('X axis')
ax.set_ylabel('Y axis')
ax.set_zlabel('Z axis')plt.show()

在这里插入图片描述

三维多个子图

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D, get_test_data
from matplotlib import cm
import numpy as np# set up a figure twice as wide as it is tall
# fig = plt.figure(figsize=plt.figaspect(0.5))
fig = plt.figure(figsize=(20,10))# ===============
#  First subplot
# ===============
# set up the axes for the first plot
ax = fig.add_subplot(1, 2, 1, projection='3d')# plot a 3D surface like in the example mplot3d/surface3d_demo
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X ** 2 + Y ** 2)
Z = np.sin(R)
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm,linewidth=0, antialiased=False)
ax.set_zlim(-1.01, 1.01)
fig.colorbar(surf, shrink=0.5, aspect=10)# ===============
# Second subplot
# ===============
# set up the axes for the second plot
ax = fig.add_subplot(1, 2, 2, projection='3d')# plot a 3D wireframe like in the example mplot3d/wire3d_demo
X, Y, Z = get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)plt.show()

在这里插入图片描述

相关文章:

matplotlib绘制三维图

目录线状堆积图 PolygonPlot三维表面图 SurfacePlot散点图ScatterPlot柱形图 BarPlot三维直方图螺旋曲线图 LinePlotContourPlot轮廓图网状图 WireframePlot箭头图二维三维合并文本图Text三维多个子图线状堆积图 PolygonPlot Axes3D.add_collection3d(col, zs0, zdir‘z’)  …...

4万字c++讲解+区分c和c++,不来可惜了(含代码+解析)

目录 1 C简介 1.1 起源 1.2 应用范围 1.3 C和C 2开发工具 3 基本语法 3.1 注释 3.2关键字 3.3标识符 4 数据类型 4.1基本数据类型 4.2 数据类型在不同系统中所占空间大小 4.3 typedef声明 4.4 枚举类型 5 变量 5.1 变量的声明和定义 5.2 变量的作用域 6 运算符…...

AcWing 482. 合唱队形

482. 合唱队形N 位同学站成一排,音乐老师要请其中的 (N−K) 位同学出列,使得剩下的 K 位同学排成合唱队形。     合唱队形是指这样的一种队形:设 K位同学从左到右依次编号为 1,2…,K,他们的身高分别为…...

Pytorch深度学习实战3-4:通俗理解张量Tensor的爱因斯坦求和(附实例)

目录1 爱因斯坦求和由来2 爱因斯坦求和原理3 实例:字母表示法3.1 向量运算3.2 矩阵运算3.3 张量运算4 实例:常量表示法4.1 向量运算4.2 矩阵运算4.3 张量运算1 爱因斯坦求和由来 爱因斯坦求和约定(Einstein summation convention)是一种标记的约定&#…...

GEE学习笔记 五十六:GEE中如何把文件导出到Google Drive的子目录

今天在群里看到有人在问一个问题,如何使用GEE把文件导出到Google Drive的子目录中?这里我就简单的说一下这个问题。 首先,在GEE中我们都知道了如何将数据导出导出Google Drive的文件夹中,如下面的一个例子: var geome…...

【Go基础】数据库编程

文章目录1. SQL语法简介2. MySQL最佳实践3. Go SQL驱动接口解读4. 数据库增删改查5. stmt6. SQLBuilder6.1 Go-SQLBuilder6.2 Gendry6.3 自行实现SQLBuilder7. GORM8. Go操作MongoDB1. SQL语法简介 SQL(Structured Query Language)是一套语法标准&#…...

【颠覆软件开发】华为自研IDE!未来IDE将不可预测!

IDE是软件开发生态的入口,但目前我们所使用的IDE基本都是由国外巨头提供,比如Visual Studio、Eclipse、JetBrains。这些IDE具有很高的断供风险,与操作系统、芯片、编程语言一样,非常重要。 随着越来越多的软件开始采用云上开发模…...

怎样从零基础学黑客

可以说想学黑客技术,要求你首先是一个“T”字型人才,也就是说电脑的所有领域你都能做的来,而且有一项是精通的。因此作为一个零基础的黑客爱好者来说,没有良好的基础是绝对不行的,下面我就针对想真正学习黑客的零基础朋…...

burp小程序抓包

身为一名码农,抓包肯定是一项必备技能。工作中遇到很多次需要对小程序进行抓包排查问题。下面分享一下我的抓包方式,使用的是电脑版小程序抓包,跟手机的方式都差不多的。 一、环境 微信版本:3.6.0.18 Burpsuite版本&#xff1a…...

文件上传攻击骚操作

允许直接上传shell 只要有文件上传功能,那么就可以尝试上传webshell直接执行恶意代码,获得服务器权限,这是最简单也是最直接的利用。 允许上传压缩包 如果可以上传压缩包,并且服务端会对压缩包解压,那么就可能存在Zip …...

Scala流程控制(第四章:分支控制、嵌套分支、switch分支、for循环控制全、while与do~while、多重与中断)

文章目录第 4 章 流程控制4.1 分支控制 if-else4.1.1 单分支4.1.2 双分支4.1.3 多分支4.2 嵌套分支4.3 Switch 分支结构4.4 For 循环控制4.4.1 范围数据循环(To)4.4.2 范围数据循环(Until)4.4.3 循环守卫4.4.4 循环步长4.4.5 嵌套…...

华为OD机试真题Python实现【整理扑克牌】真题+解题思路+代码(20222023)

整理扑克牌 题目 给定一组数字,表示扑克牌的牌面数字,忽略扑克牌的花色,请安如下规则对这一组扑克牌进行整理。 步骤一: 对扑克牌进行分组,规则如下 当牌面数字相同张数大于等于4时,组合牌为炸弹;三张相同牌面数字+两张相同牌面数字,且三张牌与两张牌不相同时,组合牌…...

【春秋云境】CVE-2022-28525

靶标介绍: ​ ED01-CMS v20180505 存在任意文件上传漏洞 打开靶场: 盲猜一波弱密码admin:admin就进去了。登录后在图中位置点击进行图片更新,需要将密码等都写上 抓包将图片信息进行替换,并修改文件名: POST /admin…...

Android设置取消系统闹钟

系统闹钟包名&#xff1a;com.android.deskclock 调用系统闹钟&#xff0c;首先在清单文件AndroidManifest.xml中添加权限&#xff1a; <uses-permission android:name"com.android.alarm.permission.SET_ALARM" />设置系统闹钟&#xff1a; public static v…...

使用 Node.js 多进程提高任务执行效率

什么是 Node 多进程&#xff1f; Node 是在单个线程中运行&#xff0c;我们虽然没办法开启额外的线程&#xff0c;但是可以开启进程集群。这样可以让下载任务和上传任务同时进行。 使用多进程进行初步代码优化 const dl require(./download.js) const ul require(./upload…...

[Golang实战]github.io部署个人博客hugo[新手开箱可用][小白教程]

[Golang实战]github.io部署个人博客hugo[新手开箱可用][小白教程]1.新手教程(小白也能学会)2.开始准备2.1myBlog是hugo的项目1.安装Hugo2.创建hugo项目2.2 xxxx.github.io是github.io中规定的pages项目3.成功部署4.TODO自动化workflows部署github.io1.新手教程(小白也能学会) …...

50个 Pandas 高频操作技巧,建议收藏

在数据分析和数据建模的过程中需要对数据进行清洗和整理等工作&#xff0c;有时需要对数据增删字段。 下面为大家介绍Pandas对数据的复杂查询、数据类型转换、数据排序、数据的修改、数据迭代以及函数的使用 文章目录技术交流01、复杂查询1、逻辑运算2、逻辑筛选数据3、函数筛…...

pygraphviz安装教程

0x01. 背景 最近在做casual inference&#xff0c;做实验时候想因果图可视化&#xff0c;遂需要安装pygraphviz&#xff0c;整了一下午&#xff0c;终于捣鼓好了&#xff0c;真头大。 环境&#xff1a; win10操作系统python3.9环境 0x02. 安装Graphviz 传送门&#xff1a;…...

HarmonyOS Connect认证测试

在HarmonyOS Connect生态产品的认证测试过程中&#xff0c;你是否存在这些疑问&#xff1a;认证流程具体包括哪些操作环节&#xff1f;如何根据实际场景选择合适的认证方式&#xff1f;如何选择认证测试标准的版本…… 本期FAQ为大家带来HarmonyOS Connect认证测试的常见问题…...

Datawhale团队第九期录取名单!

Datawhale团队 公示&#xff1a;Datawhale团队成员Datawhale成立四年了&#xff0c;从一开始的12个人&#xff0c;学习互助&#xff0c;到提议成立开源组织&#xff0c;做更多开源的事情&#xff0c;帮助更多学习者&#xff0c;也促使我们更好地成长。于是有了我们的使命&#…...

ios苹果系统,js 滑动屏幕、锚定无效

现象&#xff1a;window.addEventListener监听touch无效&#xff0c;划不动屏幕&#xff0c;但是代码逻辑都有执行到。 scrollIntoView也无效。 原因&#xff1a;这是因为 iOS 的触摸事件处理机制和 touch-action: none 的设置有关。ios有太多得交互动作&#xff0c;从而会影响…...

【Oracle】分区表

个人主页&#xff1a;Guiat 归属专栏&#xff1a;Oracle 文章目录 1. 分区表基础概述1.1 分区表的概念与优势1.2 分区类型概览1.3 分区表的工作原理 2. 范围分区 (RANGE Partitioning)2.1 基础范围分区2.1.1 按日期范围分区2.1.2 按数值范围分区 2.2 间隔分区 (INTERVAL Partit…...

#Uniapp篇:chrome调试unapp适配

chrome调试设备----使用Android模拟机开发调试移动端页面 Chrome://inspect/#devices MuMu模拟器Edge浏览器&#xff1a;Android原生APP嵌入的H5页面元素定位 chrome://inspect/#devices uniapp单位适配 根路径下 postcss.config.js 需要装这些插件 “postcss”: “^8.5.…...

【C++特殊工具与技术】优化内存分配(一):C++中的内存分配

目录 一、C 内存的基本概念​ 1.1 内存的物理与逻辑结构​ 1.2 C 程序的内存区域划分​ 二、栈内存分配​ 2.1 栈内存的特点​ 2.2 栈内存分配示例​ 三、堆内存分配​ 3.1 new和delete操作符​ 4.2 内存泄漏与悬空指针问题​ 4.3 new和delete的重载​ 四、智能指针…...

uniapp 字符包含的相关方法

在uniapp中&#xff0c;如果你想检查一个字符串是否包含另一个子字符串&#xff0c;你可以使用JavaScript中的includes()方法或者indexOf()方法。这两种方法都可以达到目的&#xff0c;但它们在处理方式和返回值上有所不同。 使用includes()方法 includes()方法用于判断一个字…...

基于Java+VUE+MariaDB实现(Web)仿小米商城

仿小米商城 环境安装 nodejs maven JDK11 运行 mvn clean install -DskipTestscd adminmvn spring-boot:runcd ../webmvn spring-boot:runcd ../xiaomi-store-admin-vuenpm installnpm run servecd ../xiaomi-store-vuenpm installnpm run serve 注意&#xff1a;运行前…...

【Linux】自动化构建-Make/Makefile

前言 上文我们讲到了Linux中的编译器gcc/g 【Linux】编译器gcc/g及其库的详细介绍-CSDN博客 本来我们将一个对于编译来说很重要的工具&#xff1a;make/makfile 1.背景 在一个工程中源文件不计其数&#xff0c;其按类型、功能、模块分别放在若干个目录中&#xff0c;mak…...

Vue 模板语句的数据来源

&#x1f9e9; Vue 模板语句的数据来源&#xff1a;全方位解析 Vue 模板&#xff08;<template> 部分&#xff09;中的表达式、指令绑定&#xff08;如 v-bind, v-on&#xff09;和插值&#xff08;{{ }}&#xff09;都在一个特定的作用域内求值。这个作用域由当前 组件…...

基于鸿蒙(HarmonyOS5)的打车小程序

1. 开发环境准备 安装DevEco Studio (鸿蒙官方IDE)配置HarmonyOS SDK申请开发者账号和必要的API密钥 2. 项目结构设计 ├── entry │ ├── src │ │ ├── main │ │ │ ├── ets │ │ │ │ ├── pages │ │ │ │ │ ├── H…...

负载均衡器》》LVS、Nginx、HAproxy 区别

虚拟主机 先4&#xff0c;后7...