Based on the first-principles of density-functional theory (DFT), the effects of NO2, NO, and NH3adsorption on the change in geometric stability, adsorption properties, and electronic structures of B- or N-doped graphene are investigated. For NO/NO2-B/N-doped graphene systems, NO/NO2have more stability on B-doped graphenes than them on N-doped graphenes. The introduction of B atom can make the adsorption of NO/NO2on graphene much easier. The stable configuration of B-doped graphene is more likely to be gas sensor for detecting toxic gases such as NO2and NO. This makes it possible to use B-dope...