Structural and electronic properties of graphene nanoflakes on Au(111) and Ag(111)