Matplotlib.axis.Tick.properties() 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.Tick.properties() Function
The Tick.properties() function in axis module of matplotlib library is used to get a dictionary of all the properties of the artist.
Syntax: Tick.properties(self)
Parameters: This method does not accepts any parameters.
Return value: This method return dictionary of all the properties of the artist.
Below examples illustrate the matplotlib.axis.Tick.properties() function in matplotlib.axis:
Example 1:
Python3
from matplotlib.axis import Tick
import numpy as np
import matplotlib.pyplot as plt
xx = np.random.rand( 3 , 4 )
fig, ax = plt.subplots()
m = ax.pcolor(xx)
m.set_zorder( 2 )
w = Tick.properties(ax)
print ( "Display first 10 Properties\n" )
for i in list (w)[: 10 ]:
print (i, ":" , w[i])
fig.suptitle('matplotlib.axis.Tick.properties() \
function Example', fontweight = "bold" )
plt.show()
|
Output:
Display first 10 Properties
adjustable : box
agg_filter : None
alpha : None
anchor : C
animated : False
aspect : auto
autoscale_on : True
autoscalex_on : True
autoscaley_on : True
axes_locator : None
Example 2:
Python3
from matplotlib.axis import Tick
import matplotlib.pyplot as plt
import numpy as np
np.random.seed( 10 * * 7 )
geeks = np.random.randn( 100 )
fig, ax = plt.subplots()
ax.acorr(geeks, usevlines = True ,
normed = True ,
maxlags = 25 , lw = 3 )
ax.grid( True )
w = Tick.properties(ax)
print ( "Display last 10 Properties\n" )
for i in list (w)[ - 10 :]:
print (i, ":" , w[i])
fig.suptitle('matplotlib.axis.Tick.properties() \
function Example', fontweight = "bold" )
plt.show()
|
Output:
Display last 10 Properties
ygridlines :
ylabel :
ylim : (-0.300605326634452, 1.061933586982593)
ymajorticklabels :
yminorticklabels :
yscale : linear
yticklabels :
yticklines :
yticks : [-0.4 -0.2 0. 0.2 0.4 0.6 0.8 1. 1.2]
zorder : 0
Last Updated :
10 Jun, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...