plot axes resizing in GUI

2 visualizaciones (últimos 30 días)
mayank agrawal
mayank agrawal el 31 de Oct. de 2015
Respondida: Aditya el 12 de Jun. de 2025
Is there a way to make the axes area fixed in a GUI?I am trying to plot an image and I require that it should only occupy the region that I have designated for that plot. What is happening is the plot is resizing the axes area accordingly the plot provided.

Respuestas (1)

Aditya
Aditya el 12 de Jun. de 2025
Hi Mayank,
You can fix the axes area in a MATLAB GUI by manually setting its position and preventing automatic resizing. Here's how:
1) Set Axes Position Manually:
ax = axes('Position', [0.1 0.1 0.8 0.8]); % [left bottom width height]
This keeps the axes in a fixed location.
2) Prevent Dynamic Resizing:
set(ax, 'Units', 'pixels'); % Fix axes size in pixels
This ensures MATLAB doesn’t adjust the axes size when the figure resizes.
Refer to the below MATLAB documentation to read more different properties in "axes" & "uiaxes":
I hope this helps!

Categorías

Más información sobre Data Exploration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by