Figure position changes after printing
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I am using R2025a and I have noticed some strange behavior with the size and position of a figure after printing. I create a figure using the call
f = figure('units','normalized','Position',[0.1 0.2 0.24 0.25])
and after the figure is generated I run the line
get(f,'Position')
The result after the get command is [0.1 0.2438 0.2002 0.2062], and not the intended value [0.1 0.2 0.24 0.25]. This is replicated exacly if I set the units and size in separate calls after using 
set(f,'Units','normalized')
set(f,'Position',[0.1 0.2 0.24 0.25])
This behavior started with R2025a. I tested these same commands in R2024b and got a figure with the appropriate values in the Position property, and it was indeed bigger than the figure generated with R2025a when compared side by side. How can I make sure that when I generate a figure I get one with the Position values that I had previously set?
PD: I tried setting the properties WindowStyle to normal, Resize to off, and ToolBar and MenuBar to none, all resulted in the same resizing of the output.
3 comentarios
  Ronit
      
 el 25 de Jul. de 2025
				After following the reproduction steps you provided, I could not reproduce the issue.
>> f = figure('units','normalized','Position',[0.1 0.2 0.24 0.25]);
>> get(f,'Position')
ans =
    0.1000    0.2000    0.2400    0.2500
If you are still facing this, I would suggest you create a Technical Support Case: https://www.mathworks.com/support/contact_us.html 
Respuestas (0)
Ver también
Categorías
				Más información sobre Graphics Object Programming 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!



