MATLAB 语 言 图形处理功能_第1页
MATLAB 语 言 图形处理功能_第2页
MATLAB 语 言 图形处理功能_第3页
MATLAB 语 言 图形处理功能_第4页
MATLAB 语 言 图形处理功能_第5页
已阅读5页,还剩53页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、2022/7/20图形处理功能Chapter Three: The function of graph manipulationMATLAB 语 言MATLAB Language2022/7/20作为一个功能强大的数学软件,Matlab具有很强的图形处理功能,提供了大量的二维、三维图形函数。由于Matlab采用面向对象的技术和丰富的矩阵运算,所以在图形处理方面即方便又高效。2022/7/203.1 二维图形基础一、 plot函数 Suppose x=x(1),x(2), , x(n) and y =y(1),y(2), , y(n) are the n-dimensional vecters.

2、 plot(x, y, S) plot a polyline connected n points (x(1), y(1), (x(2), y(2), , (x(n), y(n) one by one. Here, S is a string appointing line color, line type and symbol of data point. The string S can be omitted(省略). 可以指定线条的宽度,取值为整数(像素值),例如: plot(x,y,linewidth,4)【例1】在区间0 x2内绘制正弦曲线y=sin(x),其程序为:x=0:pi/8

3、:2*pi; y=sin(x);plot(x,y,rp-, linewidth,2)2022/7/20 plot(x1,y1,s1, x2,y2,s2, x3,y3,s3, ) combines the plots defined by the (X,Y,S) triples(增至三倍). For example, plot(x,y,k-,x,y,ro) plots the data twice, with a solid black line interpolating red circles at the data points.一、 plot函数3.1 二维图形基础【例2】在同一图形窗口

4、绘制正、余弦两条曲线y1=sin(x)和y2=cos(x),并设定颜色、线形和数据点,其程序为: x=0:pi/100:2*pi; y1=sin(x); y2=cos(x); plot(x,y1,go,x,y2,b-.)其中字符串go-和b-.表示图形的颜色、线型和数据点符号,其含义如下:2022/7/20(一)图形颜色标记点和线型 Various line types, symbols for marking data points and colors may be obtained with plot(X,Y,S), where S is a character string made

5、from one element from any or all the following 3 columns: b blue . point - solid g green o circle : dotted r red x x-mark -. dashdot c cyan + plus - dashed m magenta * star (none) no line y yellow s square k black d diamond w white v triangle (down) triangle (up) triangle (right) p pentagram h hexag

6、ram一、 plot函数3.1 二维图形基础2022/7/20(一)图形颜色标记点和线型可以通过三色调色板r,g,b设置颜色,通过hold on/off设置绘图方式为“添加/改写”方式,通过grid on/off在绘图区“添加/删除”网格。举例如下:x=-pi/6:0.3:2*pi;y=(3+sin(x).*exp(-0.2*x);z=(2+cos(x).*exp(-0.4*x);% plot(x,y,*-r,x,z,+-.b,LineWidth,2)plot(x,y,*-,LineWidth,2,Color,0.8 0 0)hold on plot(x,z,+-.,LineWidth,3,C

7、olor,0 1 1)grid off一、 plot函数3.1 二维图形基础2022/7/20(二)添加图形标记和图例 在绘制图形的同时,可以对图形加上一些说明,如图形名称、图形某一部分的含义、坐标说明等,将这些操作称为添加图形标记。 可以在图形空白处添加图例,用户还可以通过鼠标移动图例,将其放到希望的位置。 title(Fig Title) %adds Fig Title at the top of the current axis. xlabel(X-text) %adds X-text beside the X-axis on the current axis. ylabel(Y-tex

8、t) %adds Y-text beside the X-axis on the current axis. 一、 plot函数3.1 二维图形基础2022/7/20(二)添加图形标记和图例 text(X,Y,string) adds the text in the quotes to location (X,Y) on the current axes, where (X,Y) is in units from the current plot. If X and Y are vectors, TEXT writes the text at all locations given. If s

9、tring is an array the same number of rows as the length of X and Y, TEXT marks each point with the corresponding row of the string array. legend(string1,string2,string3, .) puts a legend on the current plot using the specified strings as labels. LEGEND works on line graphs, bar graphs, pie graphs, r

10、ibbon plots, etc. You can label any solid-colored patch or surface object. The fontsize and fontname for the legend strings matches the axes fontsize and fontname.一、 plot函数3.1 二维图形基础2022/7/20(二)添加图形标记和图例【例3】在同一窗口绘制y=sin(x), z=cos(x), w=0.5cos(x)在0 x2内的图像。x=0:0.3:2*pi; y=sin(x); z=cos(x); w=0.5*z;plo

11、t(x,y,ro-,x,z,b*-,x,w,ks-.) % Plot the data thricetitle( fontsize30fontname隶书三角函数图像)% title(三角函数图形,fontname,隶书,fontsize,30)% 在2014版本字体型号不可用xlabel(0 leq itt rm leq rm2pi,fontsize,16) % 0 leq itt rm leq rm2pi 中包含Latex排版命令ylabel(三角函数,fontsize,16)legend(sin(x),cos(x),0.5cos(x) text(0.1,0,Y=sinx, fontsiz

12、e,18) %在x=0.1右方以y=0为中线添加18磅大小的文本 Y=sinx一、 plot函数3.1 二维图形基础2022/7/20(三)设定坐标轴 AXIS control axis scaling and appearance. axis(xmin xmax ymin ymax) % sets scaling for the x- and y-axes on the current plot. axis(auto) %returns the axis scaling to its default, automatic axis(square) %makes the current axi

13、s box square in size. axis(equal) %sets the aspect ratio so that equal tick mark. axis(off) %turns off all axis labeling, tick marks and background. axis(on) %turns axis labeling, tick marks and background back on.一、 plot函数3.1 二维图形基础2022/7/20【例4】 在坐标范围0 x2, -2x2内绘制正弦曲线,其程序为: x=linspace(0,2*pi,60); %

14、生成含有60个数据元素的向量x %x=linspace(0,2*pi,60)等价于x=0:(2*pi-0)/(60-1):2*pi y=sin(x); plot(x,y); axis (0 2*pi -2 2); %设定坐标轴范围一、 plot函数3.1 二维图形基础2022/7/20(一)subplot(m,n,p)函数 H = subplot(m,n,p), or subplot(m,n,p), breaks the Figure window into an m-by-n matrix of small axes, selects the p-th axes for the curren

15、t plot, and returns the axis handle. The axes are counted along the top row of the Figure window, then the second row, etc. 例如,subplot(2,4,3)将整个绘图区分成2行4列共8个绘图区,指针停在第1行第3列。二、subplot函数3.1 二维图形基础2022/7/20【例5】 在一个图形窗口中同时绘制正弦、余弦、正切、余切曲线,程序为:x=linspace(0,2*pi,60);y=sin(x);z=cos(x);t=sin(x)./(cos(x)+eps);

16、%eps为系统内部常数ct=cos(x)./(sin(x)+eps);subplot(2,2,1); %分成22区域且指定1号为活动区plot(x,y);title(sin(x); axis (0 2*pi -1 1); subplot(2,2,2);plot(x,z);title(cos(x);axis (0 2*pi -1 1);subplot(2,2,3);plot(x,t);title(tangent(x);axis (0 2*pi -40 40);subplot(2,2,4);plot(x,ct);title(cotangent(x);axis (0 2*pi -40 40);二、s

17、ubplot函数3.1 二维图形基础2022/7/20(二)figure命令 figure, by itself, creates a new figure window, and returns its handle. The number of the figure window is the smallest available positive integer. figure(H) makes H the current figure, forces it to become visible, and raises it above all other figures on the s

18、creen. If Figure H does not exist, and H is an integer, a new figure is created with handle H. Execute get(H) to see a list of figure properties and their current values. Execute set(H) to see a list of figure properties and their possible values.二、subplot函数3.1 二维图形基础2022/7/20【例6】重新绘制例5中的4个图形。x=lins

19、pace(0,2*pi,60);y=sin(x);z=cos(x);t=sin(x)./(cos(x)+eps); ct=cos(x)./(sin(x)+eps);H1=figure ; %创建新窗口并返回句柄到变量H1plot(x,y) %绘制图形并设置有关属性title(sin(x); axis (0 2*pi -1 1); H2=figure; %创建第二个窗口并返回句柄到变量H2plot(x,z); %绘制图形并设置有关属性title(cos(x);axis (0 2*pi -1 1);H3=figure; %同上plot(x,t);title(tangent(x);axis (0 2

20、*pi -40 40);H4=figure; %同上plot(x,ct);title(cotangent(x);axis (0 2*pi -40 40);二、subplot函数3.1 二维图形基础2022/7/20(三)hold命令 hold on holds the current plot and all axis properties so that subsequent graphing commands add to the existing graph. hold off returns to the default mode whereby plot commands erase

21、 the previous plots and reset all axis properties before drawing new plots.二、subplot函数(四)grid命令 grid on adds major grid lines to the current axes. grid off removes major and minor grid lines from the current axes. grid minor toggles the minor grid lines of the current axes. grid, by itself, toggles

22、the major grid lines of the current axes.3.1 二维图形基础2022/7/20阅读如下程序:x=linspace(0,2*pi,60);y=sin(x);z=cos(x);plot(x,y,b); %绘制正弦曲线hold on; %设置图形保持状态plot(x,z,g); %保持正弦曲线同时绘制余弦曲线axis (0 2*pi -1 1); legend(cos,sin);hold off %关闭图形保持grid on % Adding grids in plotting area. You can cut them by grid off.二、sub

23、plot函数3.1 二维图形基础2022/7/20 fplot(FUN,LIMS,TOL) plots the function FUN between the x-axis limits specified by LIMS = XMIN XMAX. Using LIMS = XMIN XMAX YMIN YMAX also controls the y-axis limits. TOL 1,则直方条会重叠,默认值为width=0.8;bar(,grouped) 使同一组直方条紧紧靠在一起;bar(,stack) 把同一组数据描述在一个直方条上。简例:subplot(1,2,1)x=-2.5:

24、0.5:2.5; y=exp(-x.*x); %均为1*11行数组bar(x,y); %绘制有11条直方条的条形图, %第i个条的高度 等于y(i)subplot(1,2,2)x1=0,1,4; y1=1,5; 3,3; 6,2;bar(x1,y1); %绘制2组有3条直方条的条形图2022/7/203.3 其它图形函数二、条形图形bar函数应用举例:y=5 3 2 9; 4 7 2 7; 1 5 7 3; subplot(2,2,1), bar(y)x=5 9 11; subplot(2,2,2), bar3(x,y)subplot(2,2,3), bar(x,y,grouped)subpl

25、ot(2,2,4), bar(rand(2,3), 0.75,stack)三、二维杆状图stem(x)和stem(x,y)分别以 (i,x(i)和(x(i),y(i)为点绘制二维杆状图,并以实垂线将各点与x轴相连以圆圈标记各点。例如:x=0:0.4:10; y=exp(-0.3.*x).*sin(x);subplot(1,3,1), stem(x)subplot(1,3,2), stem(x,y)subplot(1,3,3), stem(x,y,:rs-)2022/7/203.3 其它图形函数四、直方图 hist(y) 在y的最小值y0和最大值y10之间插入9个分点y1,y2,y9将区间y0,

26、y1010等分,分别计算y的元素落在小区间y0,y1, (y1,y2, (y2,y3, , (y9,y10中的频数n1, n2, , n10, 分别以上述小区间为底,相应的频数为高,绘制10个实心长方条容器(bin)构成直方图。 hist(y, n) 绘制具有n个长方条容器的直方图。 n=hist(y) bins the elements of Y into 10 equally spaced containers and returns the number of elements in each container. If Y is a matrix, hist works down th

27、e columns(将向量y的元素平均分到10个等间隔的容器中,并且返回每个容器的元素个数。如果y是一个矩阵,hist指令逐列元素操作。)2022/7/203.3 其它图形函数四、直方图hist(y) 与 hist(y, n) 应用举例如下: y=rand(10000,1);figure(1), hist(y)y=randn(10000,1);figure(2), hist(y)figure(3), hist(y,20)y=randn(10000,3); %产生3维正态随机数数组figure(4), hist(y) %绘制3个直方图legend(中国,美国,俄罗斯) %添加图例五、误差棒棒图e

28、rrorbar(x, y, e)绘制误差棒棒图,e为误差向量。例如:x=0: pi/12: 2*pi; y=sin(x); e=rand(size(x)/5;errorbar(x, y, e)2022/7/203.3 其它图形函数六、饼图 pie(x) draws a pie plot of the data in the vector X. The values in X are normalized via X/SUM(X) to determine the area of each slice of pie. If SUM(X) = 1.0, the values in X direct

29、ly specify the area of the pie slices. Only a partial pie will be drawn if SUM(X) 1. pie3(x) draws a 3D pie plot. Example: subplot(1,3,1), pie(2 4 3 5) subplot(1,3,2), pie(2 4 3 5,0 0 1 0) subplot(1,3,3), pie(2 4 3 5,0 0 1 0,North,South,East,West)七、填充图形 fill(x, y, c)绘制并填充二维多边图形,x和y为二维多边形顶点坐标向量。 c 规定

30、填充颜色,其取值前已叙述。 fill3(x, y, z, c)绘制并填充三位维多面体图形。2022/7/20七、填充图形图形填充举例:subplot(2,1,1) x=0 1 1 0 0; y=0 0 1 1 0; %正方形顶点坐标向量 fill(x,y,y); %绘制并以黄色填充正方形图 subplot(2,1,2) x=0:0.025:2*pi; y=sin(2*x); fill(x,y,0.5 0.3 0.4); %绘制正弦曲线并根据颜色向量填充 Matlab系统可以用向量表示颜色,通常称其为颜色向量。基本颜色向量用r g b表示,即rgb颜色组合;以rgb为基本色,通过 r,g,b在0

31、1范围内的不同取值可以组合出各种不同的颜色。3.3 其它图形函数2022/7/203.3 其它图形函数八、隐函数绘图 ezplot(f) plots the expression f = f(x) over the default domain -2*pi x 2*pi. ezplot(f, a,b) plots f = f(x) over a x b For implicitly defined functions f = f(x,y), ezplot(f) plots f(x,y)=0 over the default domain -2*pi x 2*pi and -2*pi y 2*p

32、i ezplot(f, xmin,xmax,ymin,ymax) plots f(x,y) = 0 over xmin x xmax and ymin y ymax. ezplot(x,y) plots the parametrically defined planar curve x = x(t) and y = y(t) over the default domain 0 t 2*pi. ezplot(x,y, tmin,tmax) plots x = x(t) and y = y(t) over tmin t tmax.2022/7/203.3 其它图形函数八、隐函数绘图比较下列三个ez

33、plot语句:subplot(1,3,1); ezplot(sin(x),0,2*pi) %x0,2*pi subplot(1,3,2); ezplot(y-sin(x),0,2*pi) %x, y0,2*pi subplot(1,3,3); ezplot(y-sin(x),0,2*pi -1 1)2022/7/203.3 其它图形函数八、隐函数绘图【例9】隐函数绘图应用举例。程序如下:subplot(2,2,1);ezplot(x2+y2-9,-3 3 -3 3); axis equalsubplot(2,2,2);ezplot(x3+y3-5*x*y+1/5)subplot(2,2,3);

34、ezplot(cos(tan(pi*x), 0,1)subplot(2,2,4);ezplot(8*cos(t),4*sqrt(2)*sin(t),0,2*pi)2022/7/20九、二维绘图函数小结plot 二维图形基本函数fplot f(x)函数曲线绘制ezplot 隐函数参数方程绘图fill 填充二维多边图形polar 极坐标图bar 条形图stairs 阶梯形图pie 饼图hist 直方图scatter 彩色分散图stem 杆状图errorbar 误差棒棒图 loglog 双对数坐标图semilogx X轴为对数的坐标图semilogy Y轴为对数的坐标图axis 设置坐标轴clf 清

35、除图形窗口内容close 关闭图形窗口figure 创建图形窗口grid 放置坐标网格线gtext 用鼠标放置文本hold 保持当前图形窗口内容subplot 创建子图text 放置文本title 放置图形标题xlabel 放置X轴坐标标记ylabel 放置Y轴坐标标记legend 放置图例2022/7/203.4 三维图形一、 plot3函数plot3(x,y,z), where x, y and z are three vectors of the same length, plots a line in 3-space through the points whose coordinat

36、es are the elements of x, y and z.Various line types, plot symbols and colors may be obtained with plot3(X,Y,Z,s) where s is a 1, 2 or 3 character string made from the characters listed under the PLOT command.plot3(x1,y1,z1,s1,x2,y2,z2,s2,x3,y3,z3,s3,.) combines the plots defined by the (x,y,z,s) fo

37、urtuples.2022/7/20一、 plot3函数【例10】 绘制三维螺旋曲线,其程序为: t=0:pi/50:10*pi; y1=sin(t); y2=cos(t); plot3(y1,y2,t); title(Three-dimensional helix); text(0,0,0,Origin); xlabel(sin(t), ylabel(cos(t), zlabel(t); grid;3.4 三维图形2022/7/20二、mesh函数 mesh (X,Y,Z,C) 绘制由4个矩阵变量X,Y,Z,C定义的彩色参数网格。 (X,Y,Z)为曲面坐标,C为颜色标示变量。 mesh(X,

38、Y,Z) 使用 C = Z, 即用其高度对应的颜色进行着色。 AXIS, CAXIS, COLORMAP, HOLD, SHADING, HIDDEN和VIEW函数设置图形、坐标轴和曲面特性,他们影响网状曲面的显示效果。3.4 三维图形2022/7/20二、mesh函数 必须先生成xoy平面上的网格点坐标才能绘制曲面图,使用meshgrid函数来实现。 X Y=meshgrid(x,y) 变换向量x,y为矩阵X,Y,以便绘制3D图形。 将x视为行向量重复numel(y)行构成矩阵X,将y视为列向量重复numel(x)列构成矩阵Y。 x,y=meshgrig(x) 是x,y=meshgrid(x

39、,x)的缩写。3.4 三维图形2022/7/20二、mesh函数【例11】绘制三维曲面图z=sin(x+sin(y)-x/10。 x,y=meshgrid(0:0.25:4*pi); %生成2维网格点,等价于x,y=meshgrid(0:0.25:4*pi, 0:0.25:4*pi); z=sin(x+sin(y)-x/10; mesh(x,y,z); axis(0 4*pi 0 4*pi -2.5 1); 此外,还有带等高线的三维网格曲面函数meshc和带底座的三维网格曲面函数meshz。其用法与mesh类似,不同的是meshc还在xy平面上绘制曲面在z轴方向的等高线,meshz还在xy平面

40、上绘制曲面的底座。3.4 三维图形2022/7/20三、surf函数surf(X,Y,Z,C) 绘制由4个矩阵变量定义的彩色参数曲面. (X,Y,Z)为曲面坐标,C为颜色标示变量。XY平面上的矩形网格线对应的曲面上的网格用黑线绘制。3.4 三维图形2022/7/20三、surf函数3.4 三维图形【例12】 下列程序绘制三维曲面图形x=0:0.15:2*pi; y=0:0.15:2*pi;z=sin(y)*cos(x); %矩阵相乘产生平面网格点并计算z值figure(1), mesh(x,y,z); %绘制网格3维网格图figure(2), surf(x,y,z); %绘制3维着色表面图xl

41、abel(x-axis),ylabel(y-axis),zlabel(z-label);title(3-D surface plot);x=0:0.15:2*pi; y=0:0.15:2*pi;x y=meshgrid(x,y);z=cos(x).*sin(y); %计算各个网格点上的函数值figure(3), mesh(x,y,z); %绘制3维网格图figure(4), surf(x,y,z); %绘制3维着色表面图2022/7/20三、surf函数【例13】 通过meshgrid生成2维网格点,进而绘制三维曲面图形。 x=-1.5:0.3:1.5; y=-1:0.2:1; x, y=me

42、shgrid(x, y); % 生成2维网格点,绘图前必做! z=sqrt(4-x.2/9-y.2/4); %计算各网格点的z值 figure(1), surf(x,y,z) % 绘制3维着色表面图 figure(2), mesh(x,y,z) % 绘制3维网格图3.4 三维图形2022/7/20四、三维表面图形着色 三维表面图实际上就是在网格图的每一个网格片上涂上颜色。surf函数用缺省的着色方式对网格片着色。可以用shading命令来改变着色方式。 shading faceted命令将每个网格片用其高度对应的颜色进行着色,但网格线仍保留着,其颜色是黑色。这是系统的缺省着色方式。 shadi

43、ng flat命令将每个网格片用同一个颜色进行着色,且网格线也用相应的颜色,从而使得图形表面显得更加光滑。 shading interp命令在网格片内采用颜色插值处理,得出的表面图显得最光滑。 Colormap (色图)是MATLAB引入的概念,每个图形窗口只能有一个色图。色图是m3 的数值矩阵,它的每一行是RGB三元组。3.4 三维图形2022/7/20四、三维表面图形着色【例14】 三种图形着色方式效果展示。x,y,z=sphere(20); %产生3个2121的矩阵以便通过surf(x,y,z)产生一个单位球colormap(copper); %设置色图为铜色subplot(1,3,1)

44、;surf(x,y,z); %等同于surf(x,y,z), shading facetedaxis equalsubplot(1,3,2);surf(x,y,z); shading flat;axis equalsubplot(1,3,3);surf(x,y,z); shading interp;axis equal3.4 三维图形2022/7/20五、视点视点位置由方位角和仰角表示。方位角又称旋转角,为视点位置在XY平面上的投影与X轴形成的角度,正值表示逆时针,负值表示顺时针。仰角又称视角为XY平面的上仰或下俯角,正值表示视点在XY平面上方,负值表示视点在XY平面下方。从不同视点绘制三维图

45、形的函数为view。view(az,el)中az为方位角(正值表示自x轴逆时针旋转的度数),el为仰角(正值表示视点在物体上方),单位是度。通过系统提供的多峰函数peaks的绘制例子,可进一步说明视点对图形的影响,以及view函数的使用。Peaks函数的表达式: z = 3*(1-x).2.*exp(-(x.2) - (y+1).2) . - 10*(x/5 - x.3 - y.5).*exp(-x.2-y.2) . - 1/3*exp(-(x+1).2 - y.2) 3.4 三维图形2022/7/20【例15】 不同视角图形p=peaks; %系统提供的多峰函数,等价于%x=linspace

46、(-3,3,49); %x,y=meshgrid(x); P=peaks(x,y)subplot(2,2,1); mesh(peaks,p);view(-37.5,30); %指定子图1的视点title(azimuth=-37.5,elevation=30)subplot(2,2,2); mesh(peaks,p);view(-17,60); %指定子图2的视点title(azimuth=-17,elevation=60)subplot(2,2,3);mesh(peaks,p);view(-90,0); %指定子图3的视点title(azimuth=-90,elevation=0)subplo

47、t(2,2,4);mesh(peaks,p);view(-7,-10); %指定子图4的视点title(azimuth=-7,elevation=-10)3.4 三维图形五、视点2022/7/20六、等高线图contour函数绘制平面等高线图。contour3函数绘制3D等高线图。contour(z)在xy平面上绘制矩阵z的等高线,自动选择水平面。contour(z,n)和contour(x,y,z,n)绘制n条等高线,自动选择水平线面。【例16】 多峰函数peaks的等高线图x,y,z=peaks(30); %x和y均取30个值figure(1), contour(x,y,z,10); %绘

48、10条等高线figure(2), contour3(x,y,z,10);xlabel(x-axis),ylabel(y-axis),zlabel(z-axis);title(contour3 of peaks)3.4 三维图形2022/7/203.5 图形句柄一、句柄在Matlab系统中,绘图命令产生的每一个部分称为图形对象,系统在创建每一个对象时,都为该对象分配唯一的一个值,称其为句柄,因此句柄就是图形对象标识符。对象、句柄以及图形对象等概念其实质是统一的,系统将每一个对象按树型层次结构组织起来,这些对象包括根对象,通常为计算机屏幕、图形窗口、坐标系统、线条、曲面、文本串、用户界面控制等。2

49、022/7/20一、句柄根对象可包含一个或多个图形窗口对象,而一个图形窗口对象又可包含一组或多组坐标系子对象,线条、文本等其它对象都是坐标系的子对象。所有创建对象的函数当父对象不存在时,都会自动创建它。计算机屏幕作为根对象自动建立,其句柄值为0。而Hf_f=figure命令则建立图形窗口对象,并返回它的句柄值给变量Hf_f。图形窗口的句柄为一整数,并显示在该窗口的标题栏,其它图形对象的句柄为浮点数,Matlab提供了一系列与句柄操作有关的函数,如gcf 、gca等。为便于识别,用大写字母开头的变量表示句柄,如Hf_f等。3.5 图形句柄2022/7/20二、对象属性 所有图形对象都具有控制对象显示的属性。这些属性既包括对象的一般信息,如对象类型、对象的父对象及子对象等,也包括对象的一些特定信息,如坐标系对象的刻度等。用户可以获取、设置对象属性,以达到控制对象的目的。当创建一个对象时,系统用一组默认属性值定制对象,用户可以通过get命令获取这些属性值,同时也可通过set命令重新设置对象属性。set命令格式为: set(H,name, value, ) %将图形对象H的name属性设置为val

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论