Documentation

alpha

Add transparency to objects in axes

Syntax

alpha值
alpha alphadata
alpha facealpha
alpha alphadatAmapping
alpha(obj,___)
α(ax,___)

描述

example

alpha价值设置支持透明度的当前轴中图形对象的面部透明度。金宝app指定价值as a scalar value between 0 (transparent) and 1 (no transparency),'clear', or'不透明'

example

alphaalphadatavaries the transparency across all image, patch, chart surface, and primitive surface objects in the axes. This option sets the corresponding alpha data properties for the objects.

alphafacealphaspecifies whether to use flat or interpolated transparency across the faces of all patch, chart surface, and primitive surface objects in the axes. This option sets theFaceAlphaproperty for the objects.

example

alphaalphadatamapping控制轴上所有图像,斑块,图表表面和原始表面对象的Alpha数据值的解释。此选项设置字母摄影property for the objects.

example

α(obj,___)设置面部透明度的对象obj。选项,obj, can precede any of the input arguments in the previous syntaxes. Use single quotes around input arguments that are character arrays, for example,alpha(obj,'不透明')

α(ax,___)设置图形对象的面部透明度ax,而不是当前轴。指定axas the first input argument. You cannot specify both theaxobj输入。

例子

全部收缩

创建条形图和散点图。将条形系列和散布系列对象的面部透明度设置为0.5

bar(1:10) hold散点(10*rand(10,1),10*rand(10,1),'filled','sipedata',200) hold离开α(。5)

创建条形图和散点图。将散点系列对象的透明度设置为0.5在不影响the bar series object.

b = bar(1:10); holds =散布(10*rand(10,1),10*rand(10,1),'filled','sipedata',200); hold离开α(s,.5)

Create a surface chart. Vary the transparency across the surface based on thez价值s.

s = surf(peaks); alpha(s,'Z')

创建图像。根据颜色值改变整个图像的透明度。默认情况下,图像将透明度值夹在0到1之间。小于0的值是完全透明的,而大于1的值完全不透明。相反,将透明度值转换为使用alpha scaledcommand.

imagesc(peaks) alphacoloralpha缩放

Input Arguments

全部收缩

面部透明度值,指定为以下值之一:

  • 标量从0到1-将面部透明度设置为指定值。值为0表示透明。值为1表示不透明。0到1之间的值是半透明的。

  • 'clear'— Set the face transparency to 0 (transparent).

  • '不透明'— Set the face transparency to 1 (opaque).

If the object does not have a face or if the face has no color, then thealpha功能对对象没有视觉效果。例如,alpha对使用未填充标记或使用没有脸的标记的散点图没有视觉效果('*','+','.', 和'x')。

This table lists the graphics objects that support transparency and the associated face transparency property that updates to the value specified.

图形Object Face Transparency Property
区域对象s FaceAlpha
条对象 FaceAlpha
Scatter objects MarkerFaceAlpha
直方图和直方图对象 FaceAlpha
图像对象 AlphaData
Chart and primitive surface objects FaceAlpha
补丁对象 FaceAlpha

选择在对象上改变透明度的选项,该选项指定为该表中的值之一。表列表示每个选项如何影响不同类型的对象,具体取决于轴中包含的对象。

选项 图表或原始表面对象 补丁对象 Image Objects
'x' Set theAlphaData财产与XDataproperty and set theFaceAlphaproperty to'flat' Set the脸部财产与XDataproperty and set theFaceAlphaproperty to'flat' 没有效果。
'y' Set theAlphaData财产与YDataproperty and set theFaceAlphaproperty to'flat' Set the脸部财产与YDataproperty and set theFaceAlphaproperty to'flat' 没有效果。
'Z' Set theAlphaData财产与ZDataproperty and set theFaceAlphaproperty to'flat' Set the脸部财产与ZDataproperty and set theFaceAlphaproperty to'flat' 没有效果。
'color' Set theAlphaData财产与CDATAproperty and set theFaceAlphaproperty to'flat' Set the脸部财产与FaceVertexCDataproperty and set theFaceAlphaproperty to'flat' Set theAlphaData数据属性与CDATAproperty.
'兰德' Set theAlphaData属性为随机数的矩阵与大小相同ZDataproperty and set theFaceAlphaproperty to'flat' Set the脸部属性为随机数的矩阵与大小相同ZDataproperty and set theFaceAlphaproperty to'flat' Set theAlphaDatadata property to a matrix of random numbers the same size as theCDATAproperty.

Matrix
Use the function form of the command, for example,alpha([[1 .2; .3 .4])

Set theAlphaData属性到矩阵并设置FaceAlphaproperty to'flat'。矩阵必须与CDATA表面的特性。 Set the脸部属性到矩阵并设置FaceAlphaproperty to'flat'。矩阵必须与FaceVertexCDataproperty of the patch. Set theAlphaData数据属性到矩阵。矩阵必须与CDATAproperty of the image.

扁平或插值的透明度的选项, specified as one of the values in this table. The table columns indicate how each option affects the different types of objects, depending on what objects are contained in the axes.

选项 图表或原始表面对象 补丁对象
'flat' Set theFaceAlphaproperty to'flat'。这AlphaData属性必须是一个数组的大小与CDATAproperty. TheFaceColorproperty must be set to'flat' Set theFaceAlphaproperty to'flat'。这脸部property must be a column vector with length equal to the number of faces in the面孔property.
'Interp' Set theFaceAlphaproperty to'Interp'。这AlphaData属性必须是一个数组的大小与CDATAproperty. TheFaceColorproperty must be set to'Interp' Set theFaceAlphaproperty to'Interp'。这脸部属性必须是一个列向量,长度等于该顶点的数量顶点property.
'质地' Set theFaceAlphaproperty to'texturemap'。这FaceColorproperty must be set to'texturemap' 没有效果。

Interpretation of alpha data values, specified as'none','直接的', or'scaled'。此选项设置字母摄影图像,补丁和表面对象的属性。

  • 'none'— Interpret alpha data values as transparency values. A value of 0 or less is completely transparent. A value of 1 or greater is opaque. Values between 0 and 1 are semitransparent.

  • '直接的'— Interpret the values as indices into the figure’s alphamap. Fix values with a decimal portion to the nearest lower integer. TheAlphamapproperty of the figure contains the alphamap.

  • 'scaled'— Transform the alpha data values to span the portion of the figure’s alphamap indicated by theALim轴的属性。线性将数据值映射到alpha值。

支持透明度的图形对象,指定为标量或向量。金宝app如果要控制哪些对象,请使用此选项alpha影响。除此以外,alpha影响支持透明度的轴中的所有对象。金宝app

指定在e or more of these types of objects:

  • 区域对象

  • 条系列对象

  • 散点系列对象

  • Histogram or histogram2 object

  • 图像对象

  • Patch object

  • 图表或原始表面对象

不te

不t all objects support thealphadata,facealpha, 和alphadatamappinginput arguments. See the syntax descriptions for a list of objects that each option supports.

轴对象。如果您不指定轴,则alpha设置当前轴中图形对象的透明度。

在R2006a之前引入

这个话题有帮助吗?