exportgraphic crops the 10^N of scientific notation of the tickvalues

Hi all,
I am running at an annoying issue on the exportgraphic. Here is a simplified example.
X = 1:10;
Y = 10000*X;
plot(X,Y)
exportgraphics(gcf,'myfigure1.jpg','Resolution',300)
After exporting, the 10^N of scientific notation of the y-axis tickvalues is cropped. Can anyone give some advice?

 채택된 답변

Hey @Jue Gu,
This seems to be a bug in MATLAB R2024a. One possible workaround could be to use saveas function instead of exportgraphics.
saveas(gcf, 'myfigure1.jpg');
You can refer the following MathWorks documentation for more information on saveas function:
Hope this solves your issue.

댓글 수: 3

Thank you for your quick comment. I found that the saveas function can not set the resolution for the figure. It is not the preferable solution at the present. I hope this bug will be fix soon in the future update.
You can try print function if you want to set the resolution of the figure.
print(gcf,'myfigure1.png','-dpng','-r300'); %300dpi
Here, -r300 option sets the resolution of the figure to 300dpi.
Hi @Animesh, thank you very much. I will use print as an alternative before this bug get fixed.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

제품

릴리스

R2024a

질문:

2024년 5월 9일

댓글:

2024년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by