Export mapping toolbox-figure to epslatex

조회 수: 1 (최근 30일)
Anna S
Anna S 2019년 10월 17일
댓글: Anna S 2020년 1월 8일
Hello!
I want to include my figures into latex. If I only use png or eps format, the textsize scales with the picturesize, which is very ugly, since sometimes I need different sizes.
From gnuplot I know that it is possible to import a figure as eps and get the labels and axes as latex code (I think it was as tikzpicture format).
I searched this feature also for matlab and found
print -depslatex which is not working at my version (R2016b)
fig2texPS() which is seems to work only until R2014 and also only for 'normal' cartesian axes
matlab2tikz() which gives a lot of errormessages in latex when I compile with non-cartesian coordinates, so I believe that it is not converted correctly
Does anyone have a solution?
Thanks in advance

답변 (1개)

Subhadeep Koley
Subhadeep Koley 2020년 1월 8일
Hi, Anna you can directly print your figure to true vector eps format using -painters renderer. You can directly include the EPS in the LaTeX. Refer the demo code below.
roads = shaperead('concord_roads.shp');
figure
mapshow(roads);
xlabel('easting in meters')
ylabel('northing in meters')
print('yourEPSFigure','-depsc','-painters');
Hope this helps!
  댓글 수: 1
Anna S
Anna S 2020년 1월 8일
Thank you! I tried your code, and yes, I get an eps file which I can use for latex. But what I want is something like:
picture as eps and labels as latex format, so that I can change fontsizes etc later on.
The problem in latex occurs, when I change the picture size. Smaller pictures also get smaller labels, which are unreadable when I want to put two pictures next to each other:
exampleLatex.png
and this looks really unprofessional ;)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 LaTeX에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by