Matplotlib是Python中的一個庫,它是數字的-NumPy庫的數學擴展。的Artist類包含呈現對象的Abstract基類到一個FigureCanvas中。圖中所有可見元素都是Artist的子類。
Matplotlib.artist.Artist.axes()屬性
matplotlib庫的藝術家模塊中的axes()屬性是斧頭藝術家所在的實例,或沒有
property: Artist.axes
以下示例說明了matplotlib中的matplotlib.artist.Artist.axes()屬性:
範例1:
# Implementation of matplotlib function
from matplotlib.artist import Artist
import matplotlib.pyplot as plt
# providing values to x and y
x = [8, 5, 11, 13, 16, 23]
y = [14, 8, 21, 7, 12, 15]
# to plot x and y
plt.plot(x, y)
# use of axes() property
axs = Artist.axes
plt.text(8.5, 14, str(axs), fontweight="bold")
plt.title("""matplotlib.artist.Artist.axes()
property Example""", fontweight="bold")
plt.show()
輸出:
範例2:
# Implementation of matplotlib function
from matplotlib.artist import Artist
import matplotlib.pyplot as plt
# providing values to x and y
x = [8, 5, 11, 13, 16, 23]
y = [14, 8, 21, 7, 12, 15]
# to plot x and y
plt.plot(x, y)
plt.axes(facecolor = 'black')
axs = Artist.axes
print(str(axs))
plt.title("""matplotlib.artist.Artist.axes()
property Example""", fontweight="bold")
plt.show()
輸出:
相關用法
注:本文由純淨天空篩選整理自shivanisinghss2110大神的英文原創作品 Matplotlib.artist.Artist.axes in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。