Matplotlib.axis.Axis.is_transform_set() function in Python
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack.
matplotlib.axis.Axis.is_transform_set() Function
The Axis.is_transform_set() function in axis module of matplotlib library is used to get whether the Artist has an explicitly set transform.
Syntax: Axis.is_transform_set(self)
Parameters: This method does not accepts any parameter.
Return value: This method return whether the Artist has an explicitly set transform.
Below examples illustrate the matplotlib.axis.Axis.is_transform_set() function in matplotlib.axis:
Example 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() |
Output:
Example 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() |
Output: