Bug in print() function?

Ben Abbott bpabbott at mac.com
Tue Mar 31 06:14:20 CDT 2009


On Mar 31, 2009, at 3:08 AM, José Luis García Pallero wrote:

> Hi,
> I have one problem when I try to use the function print in Octave  
> 3.1.54 and 3.1.55. I create a plot composed of 3 subplots and I try  
> to generate a *.ps file with print() function. In Octave 3.0.3  
> compiled for me and 3.0.4 from Debian official repositories all runs  
> OK and the plot is created without errors. But with versions 3.1.54  
> and 3.1.55 compiled for me the plot created hs some errors:
>
> 1. The plot is not extended the full paper
> 2. The titles of the subplots are mixed in the upper subplots
>
> The code of my test script is:
>
> subplot(3,1,1);
> plot(randn(3));
> title('Title for the first plot');
> subplot(3,1,2);
> plot(randn(3));
> title('Title for the second plot');
> subplot(3,1,3);
> imagesc(randn(10));
> tit = sprintf('First line\nSecond line\nThird line');
> title(tit);
> print('testplot.ps','-dpsc','-F:8');
>
> Attached I send the example plots (converted to pdf for reduce the  
> size, but the original are *.ps)
>
> Someone has the same problem?
>
> Thanks

#1 is intended. The current sources respect the figure properties,  
papersize, papertype, paperpostion properties, etc.

	figure (1)
	clf
	plot (randn (50, 1))
	set (gcf, "paperunits", "inches"); # the default is "inches"
	paper_size = [8.5, 11.0];
	set (gcf, "papersize", paper_size)
	set (gcf, "papertype", "usletter")
	set (gcf, "paperposition", [0.5, 0.5, paper_size-1.0])
	print (gcf, strcat ("figtest.ps"), "-dpsc")

While listeners still need to be included to simplify specifying these  
properties.

Regarding #2, gnuplot position's the tick-labels, axis-labels, and  
title in a more liberal manner than does Matlab. However, the subplot  
does position the axes in a compatible manner. This results in problem  
with your titles. This problem is also improved by setting the  
paperposition property so that the figure fills the full page.

Ben









More information about the Bug-octave mailing list