customize export setup to generate SVG

32 ビュー (過去 30 日間)
Sriram Neelamegham
Sriram Neelamegham 2020 年 12 月 21 日
回答済み: Steve Eddins 2020 年 12 月 23 日
I am generating a series of SVG images (~ 100-200) using a MATLAB script [ver. R2020a]. I would like to specify a font type (e.g. 'SansSerif') for the text in these images to make sure the output is uniform, and so that I can also readily edited this at a later stage. I am able to do this currently by i. generatiing the figure; ii. going to file->Export Setup... dialog box; iii. choosing 'Fonts'; iv. selecting 'Custom name' and then scrolling to the desired font. v. Then Apply to Figure followed by vi. Export...
"Save as' does not let me customize the font type.
Is there a way to automate this process?, i.e. how can this be done using command line? Thanks.

回答 (1 件)

Steve Eddins
Steve Eddins 2020 年 12 月 23 日
Try this:
h = findall(fig,'-property','FontName');
set(h,'FontName','San Serif');
print(fig,'-dsvg','mygraphic.svg')

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by