Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

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

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by