Matplotlib.pyplot.delaxes() in Python (original) (raw)
Last Updated : 21 Apr, 2020
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.
matplotlib.pyplot.delaxes() Function
The delaxes() function in pyplot module of matplotlib library is used to remove the Axes ax from its figure.
Syntax: matplotlib.pyplot.delaxes(ax=None)
Parameters: This method accept the following parameters that are described below:
- ax: This parameter is the axes which is to be removed. Its default value is None.
Below examples illustrate the matplotlib.pyplot.delaxes() function in matplotlib.pyplot:
Example #1:
import
matplotlib.pyplot as plt
import
numpy as np
fig, ax
=
plt.subplots()
ax.plot([
1
,
2
,
3
])
plt.delaxes()
plt.suptitle(
'matplotlib.pyplot.delaxes() function Example'
,
`` fontweight
=
"bold"
)
plt.show()
Output:
Example #2:
import
numpy as np
import
matplotlib.pyplot as plt
dt
=
0.01
t
=
np.arange(
0
,
30
, dt)
nse1
=
np.random.randn(
len
(t))
r
=
np.exp(
-
t
/
0.05
)
cnse1
=
np.convolve(nse1, r, mode
=
'same'
)
*
dt
s1
=
np.cos(np.pi
*
t)
+
cnse1
+
np.sin(
2
*
np.pi
*
10
*
t)
fig, [ax1, ax2]
=
plt.subplots(
2
,
1
)
ax1.plot(t, s1)
ax1.set_xlim(
0
,
5
)
ax1.set_ylabel(
'value s1'
)
ax1.grid(
True
)
ax2.psd(s1,
256
,
1.
/
dt)
ax2.set_ylabel(
'PSD(db)'
)
ax2.set_xlabel(
'Frequency'
)
plt.delaxes(ax
=
ax1)
plt.suptitle(
'matplotlib.pyplot.delaxes() function Example'
,
`` fontweight
=
"bold"
)
plt.show()
Output:
Similar Reads
- Matplotlib.pyplot.axes() in Python Pyplot is another module of matplotlib that enables users to integrate MATLAB within Python environment, and thus providing MATLAB like interface and making Python visually interactive. Matplotlib.pyplot.axes() pyplot.axes is a function of the matplotlib library that adds axes to the current graph a 2 min read
- Matplotlib.pyplot.axis() in Python Matplotlib is a plotting library for creating static, animated, and interactive visualizations in Python. Pyplot is a Matplotlib module which provides a MATLAB-like interface. Matplotlib is designed to be as usable as MATLAB, with the ability to use Python and the advantage of being free and open-so 1 min read
- Matplotlib.pyplot.cla() in Python 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. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 1 min read
- Matplotlib.pyplot.draw() in Python 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. matplotlib.pyplot.draw() Function The draw() function in pyplot module of matplotlib library is used to r 1 min read
- Matplotlib.pyplot.hlines() in Python Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. Matplotlib.pyplot.hlines() The Matplotlib.pyplot.hlines() is used to draw horizontal lin 2 min read
- Matplotlib.pyplot.axvspan() in Python Matplotlib is a plotting library for creating static, animated, and interactive visualizations in Python.\ Pyplot is a Matplotlib module which provides a MATLAB-like interface. Matplotlib is designed to be as usable as MATLAB, with the ability to use Python and the advantage of being free and open-s 2 min read
- Matplotlib.pyplot.axhspan() in Python 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. matplotlib.pyplot.axhspan() Function The axhspan() function in pyplot module of matplotlib library is use 2 min read
- Matplotlib.pyplot.axvline() in Python Matplotlib is a plotting library for creating static, animated, and interactive visualizations in Python. Matplotlib can be used in Python scripts, the Python and IPython shell, web application servers, and various graphical user interface toolkits like Tkinter, awxPython, etc. Note: For more inform 2 min read
- matplotlib.pyplot.axhline() in Python 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. matplotlib.pyplot.axhline() Function The axhline() function in pyplot module of matplotlib library is use 2 min read
- Matplotlib.pyplot.gca() in Python Matplotlib is a library in Python and it is a numerical - mathematical extension for the NumPy library. Pyplot is a state-based interface to a Matplotlib module that provides a MATLAB-like interface.  matplotlib.pyplot.gca() Function The gca() function in pyplot module of matplotlib library is used 2 min read