Why saving a figure in pdf makes a dot much bigger than it is?

조회 수: 3 (최근 30일)
Armando MAROZZI
Armando MAROZZI 2021년 5월 1일
편집: Jan 2021년 5월 1일
I am plotting the following figure:
y1 = [0.2, 0.3, 0.4, 0.25, 0.2];
y2 = [0.1, 0.15, 0.18, 0, 15];
x = 1:numel(y1); % [EDITED, Jan]
h = figure;
plot(x,y1,'*-r', 'LineWidth', 1)
hold on
plot(x, y2, '*-k', 'LineWidth',1)
hold on
plot(4.5,-0.27619,'k.', 'LineWidth', 20, 'MarkerSize', 20)
box on
hold on
yline(0.15,'--','Easing threshold')
xticklabels({'July 6','July 13','July 20','July 27'})
xtickangle(45)
ylim([-0.4 0.4])
title('Outright Monetary Transactions (OMT): August 02, 2012')
set(gca,'Units','normalized')
titleHandle = get( gca ,'Title' );
pos = get( titleHandle , 'position' );
pos1 = pos + [0 0.05 0]
set( titleHandle , 'position' , pos1 );
legend('Output', 'Price', 'Financial', 'Forecast', 'Monetary', 'Rates and Spreads', 'Surveys', 'Textual', 'MP Stance', 'Easing Probability', 'Actual Realization','Orientation', 'horizontal', 'Location', 'southoutside', 'NumColumns',2)
set(h,'Units','Inches');
pos = get(h,'Position');
set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
print(h,'test','-dpdf','-r0')
The issue is that when I save it in pdf the dot becomes incredibly big (it is normal size before in matlab) as shown by the image below (the figure dispalyes is slightly different from the ones coded above):
Can anyone tell me how to correct it?
Thanks!
  댓글 수: 1
Jan
Jan 2021년 5월 1일
편집: Jan 2021년 5월 1일
See [EDITED]: I've adjusted the sizes of y1 and y2 and inserted some data for x.

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

채택된 답변

Jan
Jan 2021년 5월 1일
편집: Jan 2021년 5월 1일
plot(4.5,-0.27619,'k.', 'LineWidth', 20, 'MarkerSize', 20)
% Omit the line width:
plot(4.5,-0.27619,'k.', 'MarkerSize', 20)
It looks like MarkerSize and LineWidth are multiplied.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by