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

7 visualizaciones (últimos 30 días)
Abdullah
Abdullah el 4 de Abr. de 2024
Comentada: Abdullah el 21 de Abr. de 2024
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');

Respuestas (1)

SACHIN KHANDELWAL
SACHIN KHANDELWAL el 19 de Abr. de 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 comentario
Abdullah
Abdullah el 21 de Abr. de 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

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by