Matlab fill3()函数

fill3

Create filled 3-D patches

Syntax

fill3(X,Y,Z,C)
fill3(X1,Y1,Z1,C1,...,Xn,Yn,Zn,Cn)
fill3(___,Name,Value)
fill3(ax,___)
p = fill3(___)

Description

fill3(X,Y,Z,C) plots filled polygonal regions on 3-D axes as Patch objects with vertices at the ( x , y , z x,y,z x,y,z) locations specified by X, Y, and Z.

  • To plot one region, specify X, Y, and Z as vectors.
  • To plot multiple regions, specify X, Y, and Z as matrices where each column corresponds to a polygon.

C determines the fill colors for the regions.

Specify vectors x, y, and z as the (x,y,z) coordinates of the vertices for a triangle. Then plot the triangle with the specified fill color, red.

x = [0 0 0];
y = [0 2 1];
z = [0 0 2];
fill3(x, y, z, 'r')

在这里插入图片描述

fill3(X1,Y1,Z1,C1,...,Xn,Yn,Zn,Cn) plots multiple filled polygonal regions on the same 3-D axes.

Define vectors x1, y1, z1 and x2, y2, z2 as the (x,y,z) coordinates of the vertices for two rectangles. Specify the color of each rectangle as an RGB triplet, with values dictating the intensities of the red, green, and blue components of the color. Plot both rectangles in a single fill3 call.

x1 = [0 0 1 1];
y1 = [3 3 2 2];
z1 = [0 3 2 1];
c1 = [0 0.447 0.741];
x2 = [2 2 3 3];
y2 = [1 1 0 0];
z2 = [1 2 3 0];
c2 = [0.850 0.325 0.098];
fill3(x1, y1, z1, c1, x2, y2, z2, c2)

在这里插入图片描述

fill3(___,Name,Value) modifies the Patch objects using one or more name-value arguments to set properties. Patches can be specified using any of the input argument combinations in previous syntaxes. For example, fill3(X,Y,Z,C,'LineWidth',2) specifies a two-point border around all the patches. For a list of properties, see Patch Properties.

fill3(ax,___) plots the polygonal regions in the axes specified by ax instead of in the current axes (gca).

p = fill3(___) returns a Patch object or a vector of Patch objects. Use p to query and modify properties after plotting a region. For a full list of properties, see Patch Properties.

Specify matrices x, y, and z as the coordinates of the vertices for three adjacent squares. Specify c as a matrix of the same dimensions as x, y, and z. Each value in c specifies a colormap index for the corresponding vertex. The fill3 function interpolates the fill color of each square from the vertex colors.

x = [0 0 0; 0 0 2; 0 2 2; 0 2 0];
y = [2 0 2; 0 0 2; 0 0 0; 2 0 0];
z = [2 0 2; 2 2 2; 0 2 2; 0 0 2];
c = [2 2 2; 3 3 0; 2 2 2; 0 0 3];
fill3(x, y, z, c)

在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DoubleQ666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值