Matplotlib.axis.axis.get_minorticklines()
matplotlib库的Axis模块中的Axis.get_minorticklines()函数用于获得一个小的标记行作为Line2D实例的列表。
语法:Axis.get_minorticklines(self)
参数:该方法不接受任何参数。
返回值:该方法以Line2D实例列表的形式返回次要的标记行
下面的例子演示了matplotlib.axis.axis.get_minorticklines()函数在matplotlib.axis中的作用:
示例1
# Implementation of matplotlib function
from matplotlib.axis import Axis
from matplotlib.artist import Artist
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
def tellme(s):
ax.set_title(s, fontsize = 16)
fig.canvas.draw()
renderer = fig.canvas.renderer
Artist.draw(ax, renderer)
tellme("Matplotlib.axis.Axis.get_minorticklines()\n\
Function Example")
ax.grid()
print("Value of get_minorticklines() :",
ax.xaxis.get_minorticklines())
plt.show()
输出:
Value of get_minorticklines() : <a list of 0 Line2D ticklines objects>
示例2
# Implementation of matplotlib function
from matplotlib.axis import Axis
from matplotlib.artist import Artist
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection ='3d')
X, Y, Z = axes3d.get_test_data(0.1)
ax.plot_wireframe(X, Y, Z, rstride = 5,
cstride = 5)
ax.view_init(30, 50)
fig.canvas.draw()
renderer = fig.canvas.renderer
Artist.draw(ax, renderer)
fig.suptitle('Matplotlib.axis.Axis.get_minorticklines()\n\
Function Example')
ax.grid()
print("Value of get_minorticklines() :",
ax.xaxis.get_minorticklines())
plt.show()
输出:
Value of get_minorticklines() : <a list of 0 Line2D ticklines objects>