% print.m for octave: emulates matlab print command.
% if you run matlab and this gets found first in your path it will cause problem

function print(filename)
if nargin < 1
 %error("print: you need at least one input argument: the filename")
 %error("print: you need at least one input argument: the filename\n")
 disp("print: you need at least one input argument: the filename")
 disp("print use example: print(""temp.ps"")")
 return
end%if
%gset term postscript
gset term postscript portrait
% otherwise will be rotated 90 deg by default
eval(sprintf("gset output ""%s""",filename))
%replot "sin (x) w l"
gset title "sine wave plot"
%gset size square
%gset size normal
gset size 1,0.5
x=linspace(0,1);
plot(x,sin(2*pi*x))
eval(sprintf("system(""ls -l %s"")",filename))
eval(sprintf("system(""gs %s"")",filename))
end

