ipython_matplotlib

ipython_matplotlib(backend=None, fmt=None)[source]

Set up the matplotlib backend for ipython sessions and apply the following %config InlineBackend magic commands.

%config InlineBackend.figure_formats = fmt
%config InlineBackend.rc = {}  # never override my rc settings!
%config InlineBackend.close_figures = True  # memory issues
%config InlineBackend.print_figure_kwargs = {'bbox_inches': None}  # we use our own tight layout algorithm

This must be called before drawing any figures! For some ipython sessions (e.g. terminals) the backend can only be changed by adding matplotlib: backend to your .proplotrc file. See Configuring proplot for details.

Parameters
  • backend (str, optional) – The backend name. The default is 'auto', which applies %matplotlib inline for notebooks and %matplotlib qt for all other sessions.

    Note that when using the qt backend on macOS, you may want to prevent “tabbed” figure windows by navigating to Settings…Dock and changing “Prefer tabs when opening documents” to “Manually” (see Issue #13164).

  • fmt (str or list of str, optional) – The inline backend file format(s). Valid formats include 'jpg', 'png', 'svg', 'pdf', and 'retina'. This is ignored for non-inline backends.