From: Tony Yu <ts...@gm...> - 2012-02-14 04:31:15
|
The title is a bit misleading: The problem is that the last font-related rc-setting seems to override all previous settings. To clarify, if I save a figure with certain font settings and *after that* change the rc-setting, the older figure appears to have the newer setting. Note that this only appears to happen with fonts---the linewidth setting, for example, shows up as expected. (See script belows) -Tony import matplotlib.pyplot as plt def test_simple_plot(): fig, ax = plt.subplots() ax.plot([0, 1]) ax.set_xlabel('x-label') ax.set_ylabel('y-label') ax.set_title('title') return fig plt.rcParams['lines.linewidth'] = 10 plt.rcParams['font.family'] = 'serif' plt.rcParams['font.size'] = 20 fig1 = test_simple_plot() plt.rcParams['lines.linewidth'] = 1 plt.rcParams['font.family'] = 'sans-serif' plt.rcParams['font.size'] = 10 fig2 = test_simple_plot() plt.show() |