How to fix the position of graphs in app designer using MATLAB
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Venu Madhav Puchaginjala
 el 7 de Nov. de 2024
  
    
    
    
    
    Comentada: Venu Madhav Puchaginjala
 el 7 de Nov. de 2024
            I have created an app in PC where the Uiaxes are written in the code instead of taking directly from component library. When I want to use the same app in the laptop all the components positions are same but the graphs position are changed compared to PC view. How to fix this issue. 
0 comentarios
Respuesta aceptada
  Jaimin
 el 7 de Nov. de 2024
        When you create an app with programmatically defined UI components, like “uiaxes”, the component positions may vary across different screen resolutions and sizes. To ensure a consistent display across different devices, consider setting the “Units” property of the “uiaxes” component. 
Set the “Units” property of your UI components to “normalized”. This way, the components' positions and sizes are relative to their parent container, making them scalable with window resizing. 
Kindly refer to the following code snippet for understanding. 
% Create a figure window
fig = uifigure('Name', 'Responsive App');
% Create uiaxes with normalized units
ax = uiaxes(fig, 'Units', 'normalized', 'Position', [0.1, 0.1, 0.8, 0.8]);
% Plot data
plot(ax, rand(10,1));
For more information about “uiaxis” kindly refer following MathWorks documentation. 
I hope this will be helpful. 
Más respuestas (0)
Ver también
Categorías
				Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

