<?php
//* Do not copy above. Add the hook where it's going. Change the function name to reflect your situation.
add_action( 'your_hook', 'themeprefix_author_gravatar_outside_loop_single_post' );
//* Author Gravatar/Avatar outside of Loop on Single posts
function themeprefix_author_gravatar_outside_loop_single_post() {
if ( is_single() ) :
global $post;
$author_id = $post->post_author;
$author_link = esc_url( get_author_posts_url( get_the_author_meta( $author_id ) ) );
$author_avatar = get_avatar( $author_id, 200 );
printf( '<a href="%s">%s</a>', $author_link, $author_avatar );
endif;
}