This may not need anymore after matplotlib 3.5
.
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.pyplot.rcParams.update({
"pgf.preamble": [
"\\usepackage{arev}",
"\\usepackage[T1]{fontenc}"]
})
plt.savefig("output-bargraph.pdf", transparent=True, bbox_inches='tight')