Open
Description
I'm trying to switch to using the mplcairo
backend because it does certain things better than the MacOSX
backend, especially when colormaps have transparency. However, I've noticed that the font smoothing, at least for plots displayed on the screen, is noticeably poorer. The code below offers a MWE:
import numpy as np
from matplotlib import pyplot as plt
fig = plt.figure()
plt.plot(np.linspace(0,1,10), np.linspace(0,1,10), '-o')
plt.setp(plt.gca().get_xticklabels(), size=14)
plt.setp(plt.gca().get_yticklabels(), size=14)
With the mplcairo
backend, the tick labels look jagged and not smooth, as below.
Whereas with the MacOSX
backend gives me noticeably smoother fonts.
Everything is identical for the production of the two figures except the backend, which I switch in .matplotlibrc
. Am I missing something? Is there a way to get mplcairo
to render fonts with proper smoothing?
import mplcairo
mplcairo.get_versions()
{'python': '3.11.6 (main, Oct 12 2023, 21:46:57) [Clang 15.0.0 (clang-1500.0.40.1)]',
'mplcairo': '0.5.post32+ge771c74',
'matplotlib': '3.8.0',
'cairo': '1.17.6 @ /Users/sbasu1/packages/macports/lib/libcairo.2.dylib',
'freetype': '2.13.2 @ /Users/sbasu1/packages/macports/lib/libfreetype.6.dylib',
'pybind11': '2.11.1',
'raqm': None,
'harfbuzz': None}
Metadata
Metadata
Assignees
Labels
No labels