餐饮加盟手机网站建设,php视频网站开发实战,做配资网站,iis 如何搭建网站Figure 窗口初始化
figure 使用默认属性值创建一个新的图窗窗口。生成的图窗为当前图窗。f figure(___) 返回 Figure 对象。可使用 f 在创建图窗后查询或修改其属性。figure(f) 将 f 指定的图窗作为当前图窗#xff0c;并将其显示在其他所有图窗的上面。
figure(n) 查找 Nu…Figure 窗口初始化
figure 使用默认属性值创建一个新的图窗窗口。生成的图窗为当前图窗。f figure(___) 返回 Figure 对象。可使用 f 在创建图窗后查询或修改其属性。figure(f) 将 f 指定的图窗作为当前图窗并将其显示在其他所有图窗的上面。
figure(n) 查找 Number 属性等于 n 的图窗并将其作为当前图窗。如果不存在具有该属性值的图窗MATLAB® 将创建一个新图窗并将其 Number 属性设置为 n。
指定图窗标题
创建一个图窗并指定 Name 属性。默认情况下生成的标题包含图窗编号。
figure(Name,Measured Data);再次指定 Name 属性但这次将 NumberTitle 属性设置为 ‘off’。生成的标题不包含图窗编号。
figure(Name,Measured Data,NumberTitle,off);将背景色设置为白色
figure(Color,white)figure 属性 Alphamap: [1×64 double]BeingDeleted: offBusyAction: queueButtonDownFcn: Children: [0×0 GraphicsPlaceholder]Clipping: onCloseRequestFcn: closereqColor: [0.9400 0.9400 0.9400]Colormap: [256×3 double]ContextMenu: [0×0 GraphicsPlaceholder]CreateFcn: CurrentAxes: [0×0 GraphicsPlaceholder]CurrentCharacter: CurrentObject: [0×0 GraphicsPlaceholder]CurrentPoint: [0 0]DeleteFcn: DockControls: onFileName: GraphicsSmoothing: onHandleVisibility: onIcon: InnerPosition: [488 342 560 420]IntegerHandle: onInterruptible: onInvertHardcopy: onKeyPressFcn: KeyReleaseFcn: MenuBar: figure 默认 | noneName: Measured DataNextPlot: addNumber: 2NumberTitle: onOuterPosition: [481 334.6000 574.4000 508.8000]PaperOrientation: portraitPaperPosition: [1.3333 3.3125 5.8333 4.3750]PaperPositionMode: autoPaperSize: [8.5000 11]PaperType: usletterPaperUnits: inchesParent: [1×1 Root]Pointer: arrowPointerShapeCData: [16×16 double]PointerShapeHotSpot: [1 1]Position: [488 342 560 420]Renderer: openglRendererMode: autoResize: onScrollable: offSelectionType: normalSizeChangedFcn: Tag: ToolBar: autoType: figureUnits: pixelsUserData: []Visible: onWindowButtonDownFcn: WindowButtonMotionFcn: WindowButtonUpFcn: WindowKeyPressFcn: WindowKeyReleaseFcn: WindowScrollWheelFcn: WindowState: normal 默认 | minimized | maximized | fullscreenWindowStyle: normal 默认 | modal | docked
Figure gca 坐标轴 ALim: [0 1]ALimMode: autoAlphaScale: linearAlphamap: [1×64 double]AmbientLightColor: [1 1 1]BeingDeleted: offBox: offBoxStyle: backBusyAction: queueButtonDownFcn: CLim: [0 1]CLimMode: autoCameraPosition: [0.5000 0.5000 9.1603]CameraPositionMode: autoCameraTarget: [0.5000 0.5000 0.5000]CameraTargetMode: autoCameraUpVector: [0 1 0]CameraUpVectorMode: autoCameraViewAngle: 6.6086CameraViewAngleMode: autoChildren: [0×0 GraphicsPlaceholder]Clipping: onClippingStyle: 3dboxColor: [1 1 1]ColorOrder: [7×3 double]ColorOrderIndex: 1ColorScale: linearColormap: [256×3 double]ContextMenu: [0×0 GraphicsPlaceholder]CreateFcn: CurrentPoint: [2×3 double]DataAspectRatio: [1 1 1]DataAspectRatioMode: autoDeleteFcn: FontAngle: normalFontName: HelveticaFontSize: 10FontSizeMode: autoFontSmoothing: onFontUnits: pointsFontWeight: normalGridAlpha: 0.1500GridAlphaMode: autoGridColor: [0.1500 0.1500 0.1500]GridColorMode: autoGridLineStyle: -HandleVisibility: onHitTest: onInnerPosition: [0.1300 0.1100 0.7750 0.8150]Interactions: [1×1 matlab.graphics.interaction.interface.DefaultAxesInteractionSet]Interruptible: onLabelFontSizeMultiplier: 1.1000Layer: bottomLayout: [0×0 matlab.ui.layout.LayoutOptions]Legend: [0×0 GraphicsPlaceholder]LineStyleOrder: -LineStyleOrderIndex: 1LineWidth: 0.5000MinorGridAlpha: 0.2500MinorGridAlphaMode: autoMinorGridColor: [0.1000 0.1000 0.1000]MinorGridColorMode: autoMinorGridLineStyle: :NextPlot: replaceNextSeriesIndex: 1OuterPosition: [0 0 1 1]Parent: [1×1 Figure]PickableParts: visiblePlotBoxAspectRatio: [1 0.7882 0.7882]PlotBoxAspectRatioMode: autoPosition: [0.1300 0.1100 0.7750 0.8150]PositionConstraint: outerpositionProjection: orthographicSelected: offSelectionHighlight: onSortMethod: childorderSubtitle: [1×1 Text]SubtitleFontWeight: normalTag: TickDir: inTickDirMode: autoTickLabelInterpreter: texTickLength: [0.0100 0.0250]TightInset: [0.0438 0.0527 0.0171 0.0200]Title: [1×1 Text]TitleFontSizeMultiplier: 1.1000TitleFontWeight: boldTitleHorizontalAlignment: centerToolbar: [1×1 AxesToolbar]Type: axesUnits: normalizedUserData: []View: [0 90]Visible: onXAxis: [1×1 NumericRuler]XAxisLocation: bottomXColor: [0.1500 0.1500 0.1500]XColorMode: autoXDir: normalXGrid: offXLabel: [1×1 Text]XLim: [0 1]XLimMode: autoXLimitMethod: tickalignedXMinorGrid: offXMinorTick: offXScale: linearXTick: [1×11 double]XTickLabel: {11×1 cell}XTickLabelMode: autoXTickLabelRotation: 0XTickMode: autoYAxis: [1×1 NumericRuler]YAxisLocation: leftYColor: [0.1500 0.1500 0.1500]YColorMode: autoYDir: normalYGrid: offYLabel: [1×1 Text]YLim: [0 1]YLimMode: autoYLimitMethod: tickalignedYMinorGrid: offYMinorTick: offYScale: linearYTick: [1×11 double]YTickLabel: {11×1 cell}YTickLabelMode: autoYTickLabelRotation: 0YTickMode: autoZAxis: [1×1 NumericRuler]ZColor: [0.1500 0.1500 0.1500]ZColorMode: autoZDir: normalZGrid: offZLabel: [1×1 Text]ZLim: [0 1]ZLimMode: autoZLimitMethod: tickalignedZMinorGrid: offZMinorTick: offZScale: linearZTick: [0 0.5000 1]ZTickLabel: ZTickLabelMode: autoZTickLabelRotation: 0ZTickMode: autoFigure 窗口监听鼠标事件
MATLAB 中 Figure 窗口可以监听鼠标事件。常见的鼠标事件
鼠标按下WindowButtonDownFcn
set(fig, WindowButtonDownFcn, mouseButtonDownCallback);鼠标松开WindowButtonUpFcn
set(fig, WindowButtonUpFcn, mouseButtonUpCallback);鼠标移动WindowButtonMotionFcn
set(fig, WindowButtonMotionFcn, mouseMoveCallback);鼠标进入WindowEnterFcn
set(fig, WindowEnterFcn, mouseEnterCallback);鼠标离开WindowExitFcn
set(fig, WindowExitFcn, mouseExitCallback);鼠标滚轮滚动WindowScrollWheelFcn
set(fig, WindowScrollWheelFcn, mouseScrollWheelCallback);以上的示例中fig 是你的 Figure 句柄而 mouseButtonDownCallback、mouseButtonUpCallback、等等是相应事件触发时要执行的回调函数。你可以根据需要选择性地设置这些属性以实现相应的鼠标事件处理。
Figure 窗口监听鼠标点击事件
要在 MATLAB 中监听鼠标点击事件你可以使用 ButtonDownFcn 属性。简单的例子
% 创建一个新的 Figure
figure;% 设置 ButtonDownFcn 属性
set(gcf, ButtonDownFcn, mouseClickCallback);% 回调函数处理鼠标点击事件
function mouseClickCallback(~, ~)% 获取当前鼠标位置currentPoint get(gca, CurrentPoint);x currentPoint(1, 1);y currentPoint(1, 2);% 在命令窗口显示鼠标点击位置fprintf(Mouse Clicked at: x %f, y %f\n, x, y);
end这个例子创建了一个新的 Figure并设置了 ButtonDownFcn 属性为名为 mouseClickCallback 的回调函数。当鼠标在 Figure 上点击时该回调函数会被调用并显示当前鼠标的 x 和 y 坐标。
Figure 窗口监听鼠标移动事件
在 MATLAB 中你可以使用 WindowButtonMotionFcn 属性来监听鼠标在 Figure 上的移动事件。简单的例子
% 创建一个新的 Figure
figure;% 设置 WindowButtonMotionFcn 属性
set(gcf, WindowButtonMotionFcn, mouseMoveCallback);% 回调函数处理鼠标移动事件
function mouseMoveCallback(~, ~)% 获取当前鼠标位置currentPoint get(gca, CurrentPoint);x currentPoint(1, 1);y currentPoint(1, 2);% 在命令窗口显示鼠标位置fprintf(Mouse Position: x %f, y %f\n, x, y);
end这个例子创建了一个新的 Figure并设置了 WindowButtonMotionFcn 属性为名为 mouseMoveCallback 的回调函数。当鼠标在 Figure 上移动时该回调函数会被调用并显示当前鼠标的 x 和 y 坐标。
Figure 窗口监听鼠标鼠标按下和松开事件
要同时监听 MATLAB Figure 上的鼠标按下和松开事件你可以使用 WindowButtonDownFcn 和 WindowButtonUpFcn 属性。示例
% 创建一个新的 Figure
figure;% 设置 WindowButtonDownFcn 和 WindowButtonUpFcn 属性
set(gcf, WindowButtonDownFcn, mouseButtonDownCallback);
set(gcf, WindowButtonUpFcn, mouseButtonUpCallback);% 鼠标按下回调函数
function mouseButtonDownCallback(~, ~)disp(Mouse Button Down);
end% 鼠标松开回调函数
function mouseButtonUpCallback(~, ~)disp(Mouse Button Up);
end这个例子创建了一个新的 Figure并分别设置了 WindowButtonDownFcn 和 WindowButtonUpFcn 属性为两个不同的回调函数。当鼠标在 Figure 上按下时mouseButtonDownCallback 函数会被调用而当鼠标松开时mouseButtonUpCallback 函数会被调用。