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

5 次查看(过去 30 天)
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!

采纳的回答

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