Save last figure position

4 vues (au cours des 30 derniers jours)
Adi Navve
Adi Navve le 6 Juil 2011
Hi,
Is there a way to save the position property of the last active figure?
Regards, Adi
Edit: OK, Thank you for answering so quickly.

Réponse acceptée

Jan
Jan le 6 Juil 2011
What is "last"? The last one before closing the Matlab session? The position of a dialog before closing?
For the later you can define the CloseRequestFcn and DeletFcn such that "get(FigureHandle, 'Position')" is used to get the position and store it in the format you want.

Plus de réponses (1)

Gerd
Gerd le 6 Juil 2011
Hi Adi,
sure you can save the position of the figure.
% get current figure paper position
position = get(gcf,'PaperPosition');
Now you can save the position in a .txt file or in .mat or whatever
Gerd
  2 commentaires
Jan
Jan le 6 Juil 2011
I assume the 'Position' property is meant.
Gerd
Gerd le 6 Juil 2011
OK Jan then
position = get(gcf,'Position');
:-)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by