def add_animate_arguments(parser):
    """ add common options for animating, you may want to make sure parser was
    constructed with conflict_handler='resolve' """
    anim = parser.add_argument_group('Options for creating animations')
    anim.add_argument('-a', '--animate', default=None, help='animate results')
    anim.add_argument('--prefix', default=None, help=
        'Prefix of the output image filenames')
    anim.add_argument('-r', '--rate', dest='framerate', type=int, default=5,
        help='animation frame rate (default 5).')
    anim.add_argument('--qscale', dest='qscale', default='2', help=
        'animation quality flag (default 2).')
    anim.add_argument('-k', dest='keep', action='store_true', help=
        'keep temporary files.')
    return parser
