Change size and location of plot area in plot window

17 visualizaciones (últimos 30 días)
James Erikson
James Erikson el 1 de Mayo de 2023
How do I move and resize the actual figure size (with the axis and data) within the popup window that appears when plotting?
I want to make the popup figure window full screen, which I do through the "position" method, but I don't know how to resize and reposition the actual figure within the window.

Respuestas (1)

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro el 2 de Mayo de 2023
You need to learn how to use the handles. Instead of just plotting things, grab the handle to the figure and the axes and then you can modify the properties of each handle. This will be limited here but try this in your own computer and look for the property "position"
h1=gcf;
h2=plot(1:10,sin(1:10));
get(h1)
Alphamap: [0 0.0159 0.0317 0.0476 0.0635 0.0794 0.0952 0.1111 0.1270 0.1429 0.1587 0.1746 0.1905 0.2063 0.2222 0.2381 0.2540 0.2698 0.2857 0.3016 0.3175 0.3333 0.3492 0.3651 … ] BeingDeleted: off BusyAction: 'queue' ButtonDownFcn: '' Children: [1×1 Axes] Clipping: on CloseRequestFcn: 'closereq' Color: [1 1 1] Colormap: [256×3 double] ContextMenu: [0×0 GraphicsPlaceholder] CreateFcn: '' CurrentAxes: [1×1 Axes] CurrentCharacter: '' CurrentObject: [0×0 GraphicsPlaceholder] CurrentPoint: [0 0] DeleteFcn: '' DockControls: on FileName: '' GraphicsSmoothing: on HandleVisibility: 'on' Icon: '' InnerPosition: [671 558 577 433] IntegerHandle: on Interruptible: on InvertHardcopy: on KeyPressFcn: '' KeyReleaseFcn: '' MenuBar: 'none' Name: '' NextPlot: 'add' Number: 1 NumberTitle: on OuterPosition: [671 554 577 458] PaperOrientation: 'portrait' PaperPosition: [1.3359 3.3131 5.8283 4.3737] PaperPositionMode: 'auto' PaperSize: [8.5000 11] PaperType: 'usletter' PaperUnits: 'inches' Parent: [1×1 Root] Pointer: 'arrow' PointerShapeCData: [16×16 double] PointerShapeHotSpot: [1 1] Position: [671 558 577 433] Renderer: 'opengl' RendererMode: 'auto' Resize: on Scrollable: off SelectionType: 'normal' SizeChangedFcn: '' Tag: '' ToolBar: 'none' Type: 'figure' Units: 'pixels' UserData: [] Visible: off WindowButtonDownFcn: '' WindowButtonMotionFcn: '' WindowButtonUpFcn: '' WindowKeyPressFcn: '' WindowKeyReleaseFcn: '' WindowScrollWheelFcn: '' WindowState: 'normal' WindowStyle: 'normal' XDisplay: ':1.0'
get(h2)
AffectAutoLimits: on AlignVertexCenters: off Annotation: [1×1 matlab.graphics.eventdata.Annotation] BeingDeleted: off BusyAction: 'queue' ButtonDownFcn: '' Children: [0×0 GraphicsPlaceholder] Clipping: on Color: [0 0.4470 0.7410] ColorMode: 'auto' ContextMenu: [0×0 GraphicsPlaceholder] CreateFcn: '' DataTipTemplate: [1×1 matlab.graphics.datatip.DataTipTemplate] DeleteFcn: '' DisplayName: '' HandleVisibility: 'on' HitTest: on Interruptible: on LineJoin: 'round' LineStyle: '-' LineStyleMode: 'auto' LineWidth: 0.5000 Marker: 'none' MarkerEdgeColor: 'auto' MarkerFaceColor: 'none' MarkerIndices: [1 2 3 4 5 6 7 8 9 10] MarkerMode: 'auto' MarkerSize: 6 Parent: [1×1 Axes] PickableParts: 'visible' Selected: off SelectionHighlight: on SeriesIndex: 1 SourceTable: [0×0 table] Tag: '' Type: 'line' UserData: [] Visible: on XData: [1 2 3 4 5 6 7 8 9 10] XDataMode: 'manual' XDataSource: '' XVariable: '' YData: [0.8415 0.9093 0.1411 -0.7568 -0.9589 -0.2794 0.6570 0.9894 0.4121 -0.5440] YDataMode: 'manual' YDataSource: '' YVariable: '' ZData: [1×0 double] ZDataMode: 'auto' ZDataSource: '' ZVariable: ''

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by