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
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
採用された回答
Steven Lord
2024 年 2 月 13 日
3 件のコメント
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
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 Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!