graphics_toolkit("gnuplot")

# !! setting the figure position during the creation is mandatory with gnuplot
# it is impossible to change it afterwards
paper_width = 21;
paper_height = 12;
paper_position = [0, 0, paper_width, paper_height];
figure(1, "position", paper_position)
clf
set(gcf,'Units','centimeters');
set(gcf,'DefaultAxesUnits', 'centimeters');
set(gcf,'PaperUnits','centimeters');
set(gcf, 'papertype', '<custom>')
set(gcf, "PaperSize", [paper_width paper_height])
set(gcf, 'PaperPositionMode', 'manual');       # turn off 'auto' so it doesn't resize upon printing
#set(gcf, 'PaperPositionMode', 'auto');      # so that the exported figure looks like it does on the screen
set(gcf, "PaperOrientation", "landscape"); # wider is horizontal
set(gcf, 'PaperPosition', paper_position);
set(gcf, "Position", paper_position);

plot(1:10)
print try.pdf