I\'m trying to use Latex with matplotlib for the first time. It seems that when using Latex matplotlib uses a serif font for the axes labels. I tried explicitly setting the
Sans-serif math fonts can be used in LaTeX with the help of the sfmath package. To use this package in matplotlib, you need to alter the LaTeX preamble it uses to compile text, which can be done through the 'text.latex.preamble' rc option. Hence,
rc('text.latex', preamble='\usepackage{sfmath}')
should do what you want. You can also choose another font and supply it as an option to the package, see sfmath's documentation for reference.