MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / subplot_tool

Function subplot_tool

site-packages/matplotlib/pyplot.py:1338–1362  ·  view source on GitHub ↗

Launch a subplot tool window for a figure. A :class:`matplotlib.widgets.SubplotTool` instance is returned.

(targetfig=None)

Source from the content-addressed store, hash-verified

1336
1337
1338def 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
1365def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):

Callers

nothing calls this directly

Calls 5

SubplotToolClass · 0.90
get_current_fig_managerFunction · 0.85
figureFunction · 0.85
subplots_adjustMethod · 0.80
set_activeMethod · 0.45

Tested by

no test coverage detected