Bug in saving .fig (but not .png or .pdf) from when specifiying YAxis.Exponent as -6

6 ビュー (過去 30 日間)
In my livescript (MATLAB R2023b), I programatically save some of my plots via saveas(). I'm currently saving as a .pdf, a .png, and a .fig.
When I first specify that that the plot should have a YAxis exponent of -6 (it defaults to -5), my plots look as expected in the produced/displayed MATLAB .fig, and in the saved .pdf and .png. BUT...when I open the saved .fig, it shows an exponent of 10^2147483647. Not 10^-6 as everything else does.
I've been able to reproduce this in a .m file as well, so it doesn't seem to be related to the .mlx.
This is how I'm saving the plots:
set(gcf, 'visible', 'on'); % have to do this bc livescripts sets off, but then the figs open as invisible later
saveas(gcf,plotFullFilename,'fig')
saveas(gcf,plotFullFilename,'png')
exportgraphics(gcf,allPlotsFilename,'append',true)
This is how I set the exponent:
axA.YAxis.Exponent = -6;
axB.YAxis.Exponent = -6;
If I comment out the exponent code and let it default to a yaxis exponent to -5, then the .fig saves with an exponent of -5.
But I don't want a y-axis exponent of -5. I want it in engineering notation, e.g. an exponent of -6. This looks like a bug to me. Any ideas?
  2 件のコメント
Voss
Voss 2024 年 2 月 13 日
How are you opening the saved .fig files? When I open them using openfig, none of the y-axis exponents are 10^2147483647. (Same result if I open them through the OS, e.g., right-click in Windows Explorer and select Open.)
fn = dir('*.fig');
for ii = 1:numel(fn)
f = openfig(fn(ii).name,'visible');
end
Nicole009
Nicole009 2024 年 2 月 13 日
I was just double clicking the .fig in the Windows Explorer window. Interesting if your method is a temporary workaround. Looks like it is a documented bug per the accepted answer.

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

採用された回答

Steven Lord
Steven Lord 2024 年 2 月 13 日
This sounds like Bug Report 3147076 which is listed as fixed in release R2023b Update 6.
  3 件のコメント
Justus Gimsa
Justus Gimsa 2024 年 9 月 17 日
@Steven Lord I still have this with the function (exportgraphics(gcf,....) in 2024a, that the exponent is gone - are people working on this? ;)
Steven Lord
Steven Lord 2024 年 9 月 17 日
This particular bug is listed as fixed in both release R2023b Update 6 and release R2024a. Please contact Technical Support with a specific example and work with them to determine if there's another bug that manifests the same way that this bug fix introduced or exposed.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by