'How to configure matplotlib gui backends in ipython_kernel.config file?

I have a matplotlib backend configuration for inline plots stored in ~/.ipython/profile_default/ipython_kernel.config:

c.InlineBackend.rc = {
        'figure.figsize': (14.0, 7.0), 
        'figure.autolayout': True, 
        'figure.facecolor': 'none', 
        'axes.facecolor': 'none', 
        'axes.edgecolor': 'lightGray',
        'axes.labelcolor': 'lightGray', 
        'font.size': 10, 
        'text.color': 'lightGray', 
        'xtick.color': 'lightGray',
        'ytick.color': 'lightGray',
        'lines.linewidth': 3.0,
        #'savefig.dpi': 72, 
        #'figure.subplot.bottom': 0.125, 
        }

This configuration works for jupyters notebook, lab, qtconsole and so on as shown in this figure.

But when using gui backends like Qt5Agg and TkAgg, the configuration do not apply. I wonder if there is some way to configure these backends in a similar way as above, i.e. whithout resorting to the matplotlibrc file nor importing matplotlib and setting the rc params like mpl.rcParams['figure.figsize']=(8.0,6.0).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source