VeraM
VeraM

Reputation: 31

Changing size of new figure window on Matlab

I am making a GUI to plot spectra using Matlab. I have included a button to save an image of the plot using this simple code:

fig=figure;

h=handles.axes2;

copyobj(h,fig);

But when the new figure opens up it only shows part of the plot enter image description here

I can resize the new figure manually but I'd rather the plot was automatically put in the centre when opened up. Does anyone know of a way to do this?

Thanks in advance

Vera

Upvotes: 0

Views: 236

Answers (1)

fulp
fulp

Reputation: 28

try

set(fig, 'Position', [100, 100, 1049, 895]);

where the values are defined as [left bottom width height]

Upvotes: 1

Related Questions