Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Function print: why exported files are different in versions R2016b and R2008b?

1 vue (au cours des 30 derniers jours)
Jukka Koskinen
Jukka Koskinen le 1 Déc 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
I just got the new MatLab version (R2016b) and ran old script (R2008b) with it, but exported pdf-file was different. The used function is print, but when I use saveas-function the problem is the same: R2016b exports only part of the figure. R2008b exported file is OK. See pictures below. Is this a bug or a user error?
Used code:
if true
clear all;
close all;
x = [0:pi/20:2*pi];
y = sin(x);
plot(x,y,'r')
title('Sine wave between 0 and 2\pi')
grid on;
legend('sine wave')
% paper size
paper_A4 = [21 29.7]; % [cm]
% landscape A4
x_paper = paper_A4(2);
y_paper = paper_A4(1);
% marginal
marginal = 1; % [cm]
% picture
x_picture = x_paper-2*marginal;
y_picture = y_paper-2*marginal;
set(gca, 'Units', 'centimeters')
set(gca,'Position',[marginal marginal x_picture y_picture]); % picture on paper
set(gcf, 'PaperUnits', 'centimeters', ...
'PaperSize', [x_paper y_paper],...
'PaperPosition', [0 0 x_paper y_paper]);
%print('picture_R2016b','-dpdf')
print('picture_R2008b','-dpdf')
end
Version R2008b
Version R2016b

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by