flav-io / flavio

A Python package for flavour physics phenomenology in the Standard model and beyond
http://flav-io.github.io/
MIT License
71 stars 62 forks source link

Plotting produces warnings if no font named "Computer Modern Roman" is present #44

Closed peterstangl closed 6 years ago

peterstangl commented 6 years ago

https://github.com/flav-io/flavio/blob/409c522dce62fecc61685d85c4ac3489e79cab45/flavio/plots/config.py#L6

The above line can lead to multiple warnings during plotting if no font called "Computer Modern Roman" is installed. This might for example happen if Computer Modern Unicode (CMU) fonts are installed that use a different naming scheme such that Computer Modern Roman is called "cmu serif". Or of course if Computer Modern Roman is not installed at all and other fonts like DejaVu are used as default fonts.

I would suggest to change this line to

rc('font',**{'family':'serif',
             'serif':['Computer Modern Roman','cmu serif']+rcParams['font.serif']})

This would set the first serif font to try to 'Computer Modern Roman', the second one to 'cmu serif' and keep all other serif fonts in the list such that they are used if the first two are not found.

DavidMStraub commented 6 years ago

Fixed by #45.