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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by