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

5 ビュー (過去 30 日間)
Jue Gu
Jue Gu 2024 年 5 月 9 日
コメント済み: Jue Gu 2024 年 5 月 10 日
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?

採用された回答

Animesh
Animesh 2024 年 5 月 9 日
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 件のコメント
Animesh
Animesh 2024 年 5 月 9 日
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.
Jue Gu
Jue Gu 2024 年 5 月 10 日
Hi @Animesh, thank you very much. I will use print as an alternative before this bug get fixed.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by