I have been looking for the syntax needed to display a graphic (this one produced by ListPlot) in a new window, and do so repeatedly, each time replacing the new window contents without creating an additional new window. I would like also to generate the window at a particular size, and if it is moved while the repeated refresh is occurring, have it stay where it’s placed.
CreateDocument has a lot of options (use Options, not all of them are listed in the Documentation article), I just added WindowSize here because you asked about it. Maybe you can set the window position as well, although I can’t seem to find it right now. (But that would ensure that the output window can’t be moved.)
Anyway, the output window will now update theGraphic dynamically, so you can do this:
Actually there is a straightforward way to change the behavior of all Graphics objects (including those which do not go to the $Output channel): simply to define
$DisplayFunction = ((theGraphic = #; #) &);
An alternative to Dynamic solution is to use the second argument of CreateDocument: