Launch a subplot tool window for a figure. A :class:`matplotlib.widgets.SubplotTool` instance is returned.
(targetfig=None)
| 1336 | |
| 1337 | |
| 1338 | def subplot_tool(targetfig=None): |
| 1339 | """ |
| 1340 | Launch a subplot tool window for a figure. |
| 1341 | |
| 1342 | A :class:`matplotlib.widgets.SubplotTool` instance is returned. |
| 1343 | """ |
| 1344 | tbar = rcParams['toolbar'] # turn off the navigation toolbar for the toolfig |
| 1345 | rcParams['toolbar'] = 'None' |
| 1346 | if targetfig is None: |
| 1347 | manager = get_current_fig_manager() |
| 1348 | targetfig = manager.canvas.figure |
| 1349 | else: |
| 1350 | # find the manager for this figure |
| 1351 | for manager in _pylab_helpers.Gcf._activeQue: |
| 1352 | if manager.canvas.figure == targetfig: |
| 1353 | break |
| 1354 | else: |
| 1355 | raise RuntimeError('Could not find manager for targetfig') |
| 1356 | |
| 1357 | toolfig = figure(figsize=(6,3)) |
| 1358 | toolfig.subplots_adjust(top=0.9) |
| 1359 | ret = SubplotTool(targetfig, toolfig) |
| 1360 | rcParams['toolbar'] = tbar |
| 1361 | _pylab_helpers.Gcf.set_active(manager) # restore the current figure |
| 1362 | return ret |
| 1363 | |
| 1364 | |
| 1365 | def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None): |
nothing calls this directly
no test coverage detected