フィルターのクリア

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

5 ビュー (過去 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 Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by