exportgraphics failed when exporting PDF

I have tried to use the function exportgraphics with a figure to be exported in a PDF file in Matlab 2024b.
The function is returning several Java errors, although it was working fine on 2021a.
Is there a patch to solve this problem ? Thank you
PS : I have used the following example
plot([0 0.3 0.1 0.6 0.4 1])
ax = gca;
exportgraphics(ax,'myplots.pdf')

4 件のコメント

Walter Roberson
Walter Roberson 2025 年 3 月 11 日
Are you using linux?
JEAN BAPTISTE
JEAN BAPTISTE 2025 年 3 月 11 日
移動済み: Walter Roberson 2025 年 3 月 11 日
No, I am using Matlab R2024b on Windows 11
Adam Danz
Adam Danz 2025 年 3 月 11 日
Thanks for the reproduction code. I ran it in R2024b update 2 on a windows 11 machine but there were no errors and no unexpected behavior. I also tested it in the R2024b beta but still no problems.
If the problem appears again after a MATLAB restart, contact tech support and include a copy of the error message and stack to get more targetted help.
JEAN BAPTISTE
JEAN BAPTISTE 2025 年 3 月 12 日
移動済み: Voss 2025 年 3 月 12 日
Thanks for your answer.
Unfortunately, the problem persists after a Matlab and laptop restart.
I will contact the technical support for help.

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

回答 (1 件)

NVSL
NVSL 2025 年 4 月 22 日

0 投票

I understand you are encountering error when trying to use “exportgraphics”.
There is a workaround to download a plot using GUI. The below attached link explains the workflow.
Hope this helps!

カテゴリ

ヘルプ センター および File ExchangePrinting and Saving についてさらに検索

製品

リリース

R2024b

質問済み:

2025 年 3 月 11 日

回答済み:

2025 年 4 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by