MCPcopy Create free account
hub / github.com/ipython/ipython / matplotlib_options

Function matplotlib_options

IPython/external/qt_for_kernel.py:43–66  ·  view source on GitHub ↗
(mpl)

Source from the content-addressed store, hash-verified

41
42#Constraints placed on an imported matplotlib
43def matplotlib_options(mpl):
44 if mpl is None:
45 return
46 backend = mpl.rcParams.get('backend', None)
47 if backend == 'Qt4Agg':
48 mpqt = mpl.rcParams.get('backend.qt4', None)
49 if mpqt is None:
50 return None
51 if mpqt.lower() == 'pyside':
52 return [QT_API_PYSIDE]
53 elif mpqt.lower() == 'pyqt4':
54 return [QT_API_PYQT_DEFAULT]
55 elif mpqt.lower() == 'pyqt4v2':
56 return [QT_API_PYQT]
57 raise ImportError("unhandled value for backend.qt4 from matplotlib: %r" %
58 mpqt)
59 elif backend == 'Qt5Agg':
60 mpqt = mpl.rcParams.get('backend.qt5', None)
61 if mpqt is None:
62 return None
63 if mpqt.lower() == 'pyqt5':
64 return [QT_API_PYQT5]
65 raise ImportError("unhandled value for backend.qt5 from matplotlib: %r" %
66 mpqt)
67
68def get_options():
69 """Return a list of acceptable QT APIs, in decreasing order of

Callers 1

get_optionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected