help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

disabling graphical output in plotting for octave 2.9.x


From: Thomas Ilnseher
Subject: disabling graphical output in plotting for octave 2.9.x
Date: Mon, 26 Nov 2007 11:11:35 +0100

Hi!

up to now i was using octave 2.1.xx . 

i have written a small script like this:

#!/usr/bin/octave -qf

input_file='output.txt';
picture_phase='phase-hist.eps';
picture_freq='freq-hist.eps';

if (nargin > 0)
        input_file=char(argv(1,:));
end;
if (nargin > 1)
        picture_phase=char(argv(2,:));
end;
if (nargin > 2)
        picture_freq=char(argv(3,:));
end;

myfile=fopen(input_file, 'rb');
[data, count] = fscanf(myfile, '%f', [2, inf]);
fclose(myfile);

f=data(1,:) ./ 4;
p=data(2,:) ./ 4;

p_corr = mod(p .+ 10, 90) .- 10;

% we set terminal to none to avoid x11 window being created
__gnuplot_set__('terminal unknown');
grid on;

loghist(p_corr, 100);

legend('phase', 2);
legend('boxon');

__gnuplot_set__('terminal postscript eps color rounded');
__gnuplot_set__(['output "', picture_phase, '"']);

replot;

% this is necessary to avoid the picture before being overwritten
__gnuplot_set__('output');
__gnuplot_set__('terminal unknown'); %avoid X11 ...

grid on;
loghist(f, 100);
legend('freq',1);
legend('boxon');
__gnuplot_set__('terminal postscript eps color rounded');
__gnuplot_set__(['output "', picture_freq, '"']);
replot;

quit;

I resently have upgraded to octave 2.9.xx . of course i had to change
the nargin() and argv stuff, but whats more important:

i can't use __gnuplot_set__ anymore, as this is marked depreciated. 
now i use:

plot(blah, blubb);
print('-deps', filename);

this works, BUT: the plot command will open a window. this slows down
the operation of that program. I use this prog from an shellscript to
batch-convert a large number of data files to eps. The gnuplot windows
that pop up slow down operation and are annoying. is there any way of
getting rid of these ??

thx,

Thomas
-- 
Thomas Ilnseher <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]