Matplotlib.pyplot.subplot_tool() in Python
Last Updated :
11 Apr, 2020
Improve
Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface.
Sample Code
Python3 1==
Output:
The subplot_tool() function in pyplot module of matplotlib library is used to launch a subplot tool window for a figure.
Python3 1==
Output:
Example #2:
Python3 1==
Output:
# sample code
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [16, 4, 1, 8])
plt.show()

matplotlib.pyplot.subplot_tool() Function
Syntax:Below examples illustrate the matplotlib.pyplot.subplot_tool() function in matplotlib.pyplot: Example #1:matplotlib.pyplot.subplot_tool(targetfig=None)Parameters: This method does not accept any parameter. Returns: This method does not return any value.
# Implementation of matplotlib function
import matplotlib.pyplot as plt
import numpy as np
fig, axs = plt.subplots()
axs.plot(np.random.random((10, 10)))
plt.subplot_tool()
fig.suptitle('matplotlib.pyplot.subplot_tool() Example')
plt.show()


# Implementation of matplotlib function
import matplotlib.pyplot as plt
import numpy as np
fig, (axs, axs1) = plt.subplots(1, 2)
axs.pcolor(np.random.random((10, 10)))
axs1.imshow(np.random.random((10, 10)))
plt.subplot_tool()
fig.suptitle('matplotlib.pyplot.subplot_tool() Example')
plt.show()

