MCPcopy Index your code
hub / github.com/ipython/ipython / matplotlib_options

Function matplotlib_options

IPython/external/qt_for_kernel.py:66–90  ·  view source on GitHub ↗

Constraints placed on an imported matplotlib.

(mpl)

Source from the content-addressed store, hash-verified

64
65
66def matplotlib_options(mpl):
67 """Constraints placed on an imported matplotlib."""
68 if mpl is None:
69 return
70 backend = mpl.rcParams.get('backend', None)
71 if backend == 'Qt4Agg':
72 mpqt = mpl.rcParams.get('backend.qt4', None)
73 if mpqt is None:
74 return None
75 if mpqt.lower() == 'pyside':
76 return [QT_API_PYSIDE]
77 elif mpqt.lower() == 'pyqt4':
78 return [QT_API_PYQT_DEFAULT]
79 elif mpqt.lower() == 'pyqt4v2':
80 return [QT_API_PYQT]
81 raise ImportError("unhandled value for backend.qt4 from matplotlib: %r" %
82 mpqt)
83 elif backend == 'Qt5Agg':
84 mpqt = mpl.rcParams.get('backend.qt5', None)
85 if mpqt is None:
86 return None
87 if mpqt.lower() == 'pyqt5':
88 return [QT_API_PYQT5]
89 raise ImportError("unhandled value for backend.qt5 from matplotlib: %r" %
90 mpqt)
91
92def get_options():
93 """Return a list of acceptable QT APIs, in decreasing order of preference."""

Callers 1

get_optionsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…