clear all
v = version;
dpi = round (get (0, "screenpixelsperinch"));
paperposition = get (0, "defaultfigurepaperposition");
position = get (0, "defaultfigureposition");
paperposition(3:4) = position(3:4) / dpi;
for backend = {"gnuplot", "fltk"}
  close all
  graphics_toolkit (backend{1});
  figure (1, "position", position, "paperposition", paperposition)
  plot (rand (2))
  set (gca, "activepositionproperty", "position")
  axis ([1, 2, 0, 1])
  print (sprintf ("-r%d", dpi), sprintf ("Octave-%s-%s-predrawnow.png", v, backend{1}))
  drawnow ()
  print (sprintf ("-r%d", dpi), sprintf ("Octave-%s-%s-postdrawnow.png", v, backend{1}))
endfor


