Matplotlib.artist.artist.is_transform_set()
Python matplotlib库的artist模块中的is_transform_set()方法 用于获取Artist是否具有显式的集合变换。
语法: Artist.is_transform_set(self)
参数:该方法不接受任何参数。
该方法返回Artist是否具有显式的set转换。
下面的例子说明了matplotlib中的matplotlib.artist.artist.is_transform_set()函数:
示例1
# Implementation of matplotlib function
from matplotlib.artist import Artist
import matplotlib.pyplot as plt
fig, axs = plt.subplots()
axs.plot([1, 2, 3])
axs.set_title("Is artist is explicitly set transform : "
+str(Artist.is_transform_set(axs)))
fig.suptitle("""matplotlib.artist.Artist.is_transform_set()
function Example""", fontweight="bold")
plt.show()
输出:
示例2
# Implementation of matplotlib function
from matplotlib.artist import Artist
import matplotlib.pyplot as plt
fig, (axs, axs2) = plt.subplots(2, 1)
gs = axs2.get_gridspec()
axbig = fig.add_subplot(gs[1:, -1])
axbig.annotate("Second Axes", (0.4, 0.5),
xycoords ='axes fraction',
va ='center')
axs.set_title("Is artist is explicitly set transform : "
+str(Artist.is_transform_set(axs)))
fig.suptitle("""matplotlib.artist.Artist.is_transform_set()
function Example""", fontweight="bold")
plt.show()
输出: