필터 지우기
필터 지우기

Saving as EMF messes up my labels and ticks

조회 수: 9 (최근 30일)
CalinV
CalinV 2015년 5월 18일
답변: Maksym Girnyk 2016년 2월 16일
Good day,
I need to save some figures in ".emf" format (best quality & rescaling). The problem is with the label text and with axes ticks, they get shifted in the printed(saved) version. This is a simple example of a figure:
figure;
x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));
plot(x,y,'--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10)
xlabel('This text should be centered');
ylabel('This text should be centered');
title('This text should be centered');
Bellow you can see the figure saved as .jpg, and then as .emf:
As you can see is the second picture (.emf) the labels and ticks are shifted. I would be grateful if anyone could help me solve this issue. Thank you !

채택된 답변

Nalini Vishnoi
Nalini Vishnoi 2015년 5월 19일
편집: Nalini Vishnoi 2015년 5월 19일
Hi Calin,
Are you using MATLAB R2014b? This is a known issue with printing or saving to the EMF format in MATLAB R2014b. It appears that sometimes, saving the figure to a FIG file, restarting MATLAB, opening the FIG file and printing it resolves the issue.
Another work around for this issue is to use "print" command twice as shown in the following lines of code:
>> figHandle = figure;
>> figData = magic(4);
>> plot(figData);
>> legend('Data 1','Data 2','Data 3','Data 4','Location','north');
>> print dmeta;
>> print (figHandle,'-dmeta','-painters','-r864','dataFigure');
I would also suggest to try it in MATLAB R2015a. The EMF file came out correctly for me in the newer version of MATLAB (R2015a). I hope this helps!
Nalini
  댓글 수: 2
CalinV
CalinV 2015년 5월 20일
Thank you Nalini, both solutions work for me, the "double" printing being useful for my problem where I have to automatically generate and save dozens of pictures. I just hope this problem will be solved with the upcoming matlab release.
Nalini Vishnoi
Nalini Vishnoi 2015년 5월 20일
You are very welcome! I am glad that the suggestion worked!
Nalini

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

추가 답변 (1개)

Maksym Girnyk
Maksym Girnyk 2016년 2월 16일
A rather silly solution that works for me is to just open an arbitrary fig-file in Matlab. After this printing to an emf-file works as it should, until I close Matlab again.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by