saving .fig files doesn't save position properties?

16 ビュー (過去 30 日間)
Karen
Karen 2014 年 7 月 7 日
コメント済み: Geoff Hayes 2014 年 7 月 8 日
Hi, I have been trying to save a .fig file so that it can be edited in the Matlab Figure Editor and then saved. However, I find that when I save a .fig file, any position properties are not saved. Am I doing something wrong? For example, if I run the following code:
x = 1:10;
y = 1:10;
plot(x, y);
t = title('Title');
set(t, 'position', [0 0 10]);
savefig('figure1.fig');
the title's position is not saved, although if I set other properties (fontsize, etc) those are saved. Any thoughts? Thanks!
  1 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 7 月 8 日
You are not doing anything wrong. It may be just that the software assumes that all figure titles are displayed in the top centre. From the documentation, see title, the default behaviour is
title(str) adds the title consisting of a string, str, at the top and in the center of the current axes. Each axes graphics object has one predefined title.
The documentation doesn't discuss moving the title around, though since this is allowed, the new title position should be saved to the figure file when calling savefig. This could very well be a bug.

サインインしてコメントする。

回答 (2 件)

William beason
William beason 2014 年 7 月 7 日
編集済み: Star Strider 2014 年 7 月 7 日
No i don't think you should save file in wrong format. .fig files sometimes not save once try some more time or some problem in path where you save other document and figure files.
  1 件のコメント
Karen
Karen 2014 年 7 月 8 日
I have tried many times--I believe this is a feature of MATLAB but I am not sure if it is a bug or deliberate, or what the best workaround is.

サインインしてコメントする。


Sean de Wolski
Sean de Wolski 2014 年 7 月 8 日
Hi Karen,
That certainly looks obscure to me. Contact tech-support and let them know about it.

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by