Show More
@@ -33,6 +33,17 b" backends = {'tk': 'TkAgg'," | |||||
33 | 'osx': 'MacOSX', |
|
33 | 'osx': 'MacOSX', | |
34 | 'inline' : 'module://IPython.zmq.pylab.backend_inline'} |
|
34 | 'inline' : 'module://IPython.zmq.pylab.backend_inline'} | |
35 |
|
35 | |||
|
36 | # We also need a reverse backends2guis mapping that will properly choose which | |||
|
37 | # GUI support to activate based on the desired matplotlib backend. For the | |||
|
38 | # most part it's just a reverse of the above dict, but we also need to add a | |||
|
39 | # few others that map to the same GUI manually: | |||
|
40 | backend2gui = dict(zip(backends.values(), backends.keys())) | |||
|
41 | # In the reverse mapping, there are a few extra valid matplotlib backends that | |||
|
42 | # map to the same GUI support | |||
|
43 | backend2gui['GTK'] = backend2gui['GTKCairo'] = 'gtk' | |||
|
44 | backend2gui['WX'] = 'wx' | |||
|
45 | backend2gui['CocoaAgg'] = 'osx' | |||
|
46 | ||||
36 | #----------------------------------------------------------------------------- |
|
47 | #----------------------------------------------------------------------------- | |
37 | # Matplotlib utilities |
|
48 | # Matplotlib utilities | |
38 | #----------------------------------------------------------------------------- |
|
49 | #----------------------------------------------------------------------------- | |
@@ -167,9 +178,7 b' def find_gui_and_backend(gui=None):' | |||||
167 | backend = matplotlib.rcParams['backend'] |
|
178 | backend = matplotlib.rcParams['backend'] | |
168 | # In this case, we need to find what the appropriate gui selection call |
|
179 | # In this case, we need to find what the appropriate gui selection call | |
169 | # should be for IPython, so we can activate inputhook accordingly |
|
180 | # should be for IPython, so we can activate inputhook accordingly | |
170 |
g |
|
181 | gui = backend2gui.get(backend, None) | |
171 | b2g = dict(zip(g2b.values(), g2b.keys())) # reverse dict |
|
|||
172 | gui = b2g.get(backend, None) |
|
|||
173 | return gui, backend |
|
182 | return gui, backend | |
174 |
|
183 | |||
175 |
|
184 |
General Comments 0
You need to be logged in to leave comments.
Login now