The problem to decide whether a given rational function in several variables is positive, in the sense that all its Taylor coefficients are positive, goes back to Szegő as well as Askey and Gasper, who inspired more recent work. It is well known that the diagonal coefficients of rational functions are $D$-finite. This note is motivated by the observation that, for several of the rational functions whose positivity has received special attention, the diagonal terms in fact have arithmetic significance and arise from differential equations that have modular parametrization. In each of these cases, this allows us to conclude that the diagonal is positive. Further inspired by a result of Gillis, Reznick and Zeilberger, we investigate the relation between positivity of a rational function and the positivity of its diagonal.