In this paper, the adsorption behavior of pyridine, a typical basic nitrogen compound in diesel oil, on Ti-doped, Zr-doped, N-doped and intrinsic graphene has been investigated by density functional methods. The corresponding adsorption energy, adsorption configurations, Mulliken charge transfer, differential charge density and density of states were discussed. The results show that doping graphene with metal atoms such as Ti or Zr can significantly obviously enhance the adsorption energy between pyridine and graphene surfaces, while non-metal N doping has a relatively minor effect. The magnitude of the adsorption energy of pyridine on the surfaces of graphene modified with different atoms follows the order: Ti-doped>Zr-doped>N-doped>intrinsic graphene. Pyridine interacts with Ti- or Zr-doped graphene through N−Ti, N−Zr and π−π interactions, while with N-doped and intrinsic graphene, it interacts via N−N, C−N and π−π interactions. There are significantelectron transfer and chemical bond formation between pyridine and metal-doped (Ti, Zr) graphene surfaces, indicating chemical adsorption. However, there is no chemical bond formation with non-metal N-doped graphene and intrinsic graphene, suggesting physical adsorption in these cases. Overall, pyridine exhibits more stable adsorption on the surfaces of Ti, Zr-doped graphene.