set(0, "defaultfigurepaperunits", "centimeters");
set(0, "defaultfigurepapertype", "a4");

device = {"gnuplot", "fltk", "qt"};

x = linspace(0, 1, 12);
s = sin(2 * pi * x);
c = cos(2 * pi * x);

for n = 1 : 3
   graphics_toolkit(device{n});
   graphics_toolkit
%   figure(n, "position", [0, 0, 1000, 700],    % produces error
%             "paperposition", [0, 0, 10, 7]);  % produces error
   figure(n, "paperposition", [0, 0, 10, 7]);   % works
   axes("fontname", "Arial", "fontsize", 12);
   plot(x, s, x, c);
   grid;
   legend("sin", "cos");
   legend("boxoff"); legend("left");
   xlabel("t"); ylabel("sin/cos");
%   print(strcat(device{n}, ".jpg"), "-djpg", "-FArial:12");  % produces error
   print(strcat(device{n}, ".jpg"), "-djpg");  % works
end
