필터 지우기
필터 지우기

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

조회 수: 3 (최근 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.

추가 답변 (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