フィルターのクリア

exporting figure as .pdf causes axis title to display the Angstrom character incorrectly

2 ビュー (過去 30 日間)
Lucas Wong
Lucas Wong 2022 年 6 月 8 日
コメント済み: Lucas Wong 2023 年 10 月 23 日
Hi all,
I have produced a plot and have labelled the axes as such:
xlabel('q (Å^{-1})', 'FontSize', 18)
ylabel('F(q) (barns sr ^{-1} atom^{-1})', 'FontSize', 18)
I have then exported the plot as a .pdf file with the following line:
exportgraphics(gcf,'example.pdf','ContentType','vector')
These steps have produced the image below. As you can see the x-axis is displayed incorrectly, featuring a "#" in place of the "Å" symbol. I have tried exporting as an .eps file and that works fine, but unfortunately I need a .pdf file.
Any help is greatly appreciated!
  3 件のコメント
Lucas Wong
Lucas Wong 2022 年 6 月 30 日
Hi Chris,
Sorry for the late reply. I am using MATLAB version R2021a Update 6 on MAC.
Lucas Wong
Lucas Wong 2023 年 10 月 23 日
@Cris LaPierre Problem fixed by updating to R2023b.

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

回答 (2 件)

Monica Roberts
Monica Roberts 2022 年 6 月 8 日
It seems to work ok if you use ContentType image. I'd mess with the resolution if you go this route so you get a better looking image.
This looks like it might be a bug with exportgraphics. I'd suggest reporting it to MathWorks; they might have a better answer for you.
exportgraphics(gcf,'example.pdf','ContentType','image')

Detmer Bosma
Detmer Bosma 2023 年 2 月 14 日
編集済み: Detmer Bosma 2023 年 2 月 14 日
I solved this problem by selecting another Font. Just adding:
set(gca,'FontName','Arial')
and still using
exportgraphics(gcf, 'example.pdf', 'ContentType','vector')
did it for me!

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by