daft-dev / daft

Render probabilistic graphical models using matplotlib
https://docs.daft-pgm.org
MIT License
675 stars 118 forks source link

Default fonts not working #128

Closed taylorwwebb closed 3 years ago

taylorwwebb commented 3 years ago

I'm sure this is something that's wrong on my end, but I can't figure it out: when I try to run 'The Quintessential PGM' demo, followed by a call to pgm.savefig, the resulting image uses a sans serif font, rather than the default fonts shown in the documentation (image below). Any idea what I might be doing wrong?

prob_graph

dfm commented 3 years ago

Sure! The examples are all run with the following rcParams:

import matplotlib.pyplot as mpl
mpl.rcParams["font.family"] = "serif"
mpl.rcParams["font.size"] = 12
mpl.rcParams["text.usetex"] = True
mpl.rcParams["figure.dpi"] = 150

Hope this helps!

taylorwwebb commented 3 years ago

this worked, thanks!