Reputation: 11
I'm trying to print a pdf plot in GNU Octave. The graph is shown on the plot schreen. Unfortunately the plot does not show the full graph when opening the plot in the PDF document.
Strangely enough the issue does not occur when I print the plot in png, print(h,'Test.png',"-dpng")
. Below i have made an example code to illustrate the problem. Does anyone know how to resolve this issue?
close all
clear all
clc
x = [0:0.001:1]';
y = zeros(size(x,1),10);
y(:,1) = arrayfun(@(x) x^(1/5),x);
y(:,2) = arrayfun(@(x) x^(1/4),x);
y(:,3) = arrayfun(@(x) x^(1/3),x);
y(:,4) = arrayfun(@(x) x^(1/2),x);
y(:,5) = arrayfun(@(x) x,x);
y(:,6) = arrayfun(@(x) x^2,x);
y(:,7) = arrayfun(@(x) x^3,x);
y(:,8) = arrayfun(@(x) x^4,x);
y(:,9) = arrayfun(@(x) x^5,x);
y(:,10) = arrayfun(@(x) x^6,x);
h = figure
hold on
for i = 1:10
plot(x,y(:,i))
end
grid
set(gcf,'papert', '<custom>')
set(gcf,'paperunits','centimeters');
set(gcf,'papersize',[29.7 21])
set(gcf,'paperposition', [1 1 27.7 19])
set(gcf,'defaultaxesposition', [0.15, 0.15, 0.75, 0.75])
set (0,'defaultaxesfontsize', 11)
print(h,'Test.pdf',"-dpdf")
Thanks in advance
P.S Using version 8.4.0 at this moment.
Thomas
I tried printing png and pdf.
Upvotes: 1
Views: 375
Reputation: 11
I reported this problem as a bug on https://savannah.gnu.org/. It turns out that when using a windows installer you need to select "SoftWare OpenGL Driver" in the setup wizard in stead of using the default settings. After reinstalling Octave with this setting the rendering of the plots worked fine.
Thomas
Upvotes: 0