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

1 visualización (últimos 30 días)
Armando MAROZZI
Armando MAROZZI el 1 de Mayo de 2021
Editada: Jan el 1 de Mayo de 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 comentario
Jan
Jan el 1 de Mayo de 2021
Editada: Jan el 1 de Mayo de 2021
See [EDITED]: I've adjusted the sizes of y1 and y2 and inserted some data for x.

Iniciar sesión para comentar.

Respuesta aceptada

Jan
Jan el 1 de Mayo de 2021
Editada: Jan el 1 de Mayo de 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.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by