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

1 view (last 30 days)
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');

Answers (1)

SACHIN KHANDELWAL
SACHIN KHANDELWAL on 19 Apr 2024
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 Comment
Abdullah
Abdullah on 21 Apr 2024
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

Sign in to comment.

Categories

Find more on Printing and Saving in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!