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 CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by