Filter löschen
Filter löschen

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

5 Ansichten (letzte 30 Tage)
Armando MAROZZI
Armando MAROZZI am 1 Mai 2021
Bearbeitet: Jan am 1 Mai 2021
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 Kommentar
Jan
Jan am 1 Mai 2021
Bearbeitet: Jan am 1 Mai 2021
See [EDITED]: I've adjusted the sizes of y1 and y2 and inserted some data for x.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 1 Mai 2021
Bearbeitet: Jan am 1 Mai 2021
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.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by