Tuning the deposition of molecular graphene nanoribbons by surface functionalization.