Why isn't the text on a figure selectable when using 'Tex' as interpreter?

2 ビュー (過去 30 日間)
Abdullah
Abdullah 2024 年 4 月 4 日
コメント済み: Abdullah 2024 年 4 月 21 日
when i use 'Tex' as interpreter in order to obtain scientific notation and text on figures generated in MATLAB, the text is no longer selectable when using 'Tex' as interpreter on the generated svg-files using inkscape, but it rather appears as an editable shape or path. The issue is that I would like to have the text exported as text within the svg-file in order to manually edit its font and export it as pdf_tex into overleaf (LateX).
Why isn't the text on a figure selectable when using 'Tex' as interpreter?
fig1=figure(1)
surf(X,Y,PsiDD(:,:,36)');
xlabel('current angle $\beta$[deg]','Interpreter','tex'); ylabel('$I_{f}$[A]','Interpreter','tex'); zlabel('${\psi}_{d}$[Vs]','Interpreter','tex');
%set(findall(fig1,'-property','Interpreter'),'Interpreter','tex')
picturewidth = 8.529;
hw_ratio = 3/4;
set(fig1,'Units','centimeters','Position',[0 0 picturewidth hw_ratio*picturewidth])
pos = get(fig1,'Position');
set(fig1,'PaperPositionMode','Auto','PaperUnits','centimeters','PaperSize',[pos(3), pos(4)])
print(fig1,'PsiD','-dsvg','-painters');

回答 (1 件)

SACHIN KHANDELWAL
SACHIN KHANDELWAL 2024 年 4 月 19 日
Hi Abdullah,
The problem you are facing might be due to a rendering issue.
For complex graphics such as surface plots, MATLAB automatically switch to OpenGL rendering which renders the plot as compressed .bmp graphics.
You can use the following MATLAB code.
>> set(gcf, 'Renderer', 'painters');
Hoping it will help you move ahead with your workflow.
Thanks
  1 件のコメント
Abdullah
Abdullah 2024 年 4 月 21 日
Hi Sachin,
Thank you for your comment. well this already included in my last code:
print(fig1,'PsiD','-dsvg','-painters');
i found the solution by removing the 'Interpreter','tex' from code, i think matlab faces problem when generating 'painters' when it contains Latex interpreter

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

カテゴリ

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