As an example of a program generating a series of consecutively numbered
PostScript files is available here.
It generates and displays a series of binomial distributions.
The following subroutine is used by the program to name and open ps files
animxyz.ps, where xyz is given by the argument frameno.
It also creates a square frame, which acts as a bounding box when the
-trim option is used in the format conversion. Finally, it
rescales the box to be of size 100x100.
integer :: i1,i2,i3,frameno
character(16) :: fname
write(1,*)'1 1 scale 0 0 translate 0.5 0.5 moveto'
write(1,*)'612 0 rlineto 0 612 rlineto -612 0 rlineto 0 -612 rlineto'
write(1,*)'6.12 6.12 scale'
end subroutine initframe
The animation below is in gif-format, it was created from the ps files
using convert as discussed above.