📌  相关文章
📜  Python中的 Matplotlib.axis.Axis.is_transform_set()函数

📅  最后修改于: 2022-05-13 01:55:02.651000             🧑  作者: Mango

Python中的 Matplotlib.axis.Axis.is_transform_set()函数

Matplotlib是Python中的一个库,它是 NumPy 库的数值数学扩展。它是Python中用于二维数组图的惊人可视化库,用于处理更广泛的 SciPy 堆栈。

matplotlib.axis.Axis.is_transform_set()函数

matplotlib 库的轴模块中的Axis.is_transform_set()函数用于获取 Artist 是否具有显式设置的变换。

下面的示例说明了 matplotlib.axis 中的 matplotlib.axis.Axis.is_transform_set()函数:
示例 1:

Python3
# Implementation of matplotlib function
from matplotlib.axis import Axis
import matplotlib.pyplot as plt 
     
fig, axs = plt.subplots() 
axs.plot([1, 2, 3]) 
    
axs.set_title("Is artist is explicitly set transform : "
              +str(Axis.is_transform_set(axs)))   
  
fig.suptitle('matplotlib.axis.Axis.is_transform_set() \
function Example\n', fontweight ="bold")  
    
plt.show()


Python3
# Implementation of matplotlib function
from matplotlib.axis import Axis
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.5, 0.6), 
               xycoords ='axes fraction', 
               va ='center') 
      
    
axs.set_title("Is artist is explicitly set transform : "
              +str(Axis.is_transform_set(axs)))   
  
fig.suptitle('matplotlib.axis.Axis.is_transform_set() \
function Example\n', fontweight ="bold")  
    
plt.show()


输出:

示例 2:

Python3

# Implementation of matplotlib function
from matplotlib.axis import Axis
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.5, 0.6), 
               xycoords ='axes fraction', 
               va ='center') 
      
    
axs.set_title("Is artist is explicitly set transform : "
              +str(Axis.is_transform_set(axs)))   
  
fig.suptitle('matplotlib.axis.Axis.is_transform_set() \
function Example\n', fontweight ="bold")  
    
plt.show() 

输出: