Matplotlib.artist.Artist.axes in Python
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Artist class contains Abstract base class for objects that render into a FigureCanvas. All visible elements in a figure are subclasses of Artist.
Matplotlib.artist.Artist.axes() property
The axes() property in artist module of matplotlib library is the Axes instance the artist resides in, or None
property: Artist.axes
Below examples illustrate the matplotlib.artist.Artist.axes() property in matplotlib:
Example 1:
from matplotlib.artist import Artist
import matplotlib.pyplot as plt
x = [ 8 , 5 , 11 , 13 , 16 , 23 ]
y = [ 14 , 8 , 21 , 7 , 12 , 15 ]
plt.plot(x, y)
axs = Artist.axes
plt.text( 8.5 , 14 , str (axs), fontweight = "bold" )
plt.title(
, fontweight = "bold")
plt.show()
|
Output:
Example 2:
from matplotlib.artist import Artist
import matplotlib.pyplot as plt
x = [ 8 , 5 , 11 , 13 , 16 , 23 ]
y = [ 14 , 8 , 21 , 7 , 12 , 15 ]
plt.plot(x, y)
plt.axes(facecolor = 'black' )
axs = Artist.axes
print ( str (axs))
plt.title(
, fontweight = "bold")
plt.show()
|
Output:
Last Updated :
15 May, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...