Matplotlib是Python中的一個庫,它是數字的-NumPy庫的數學擴展。 Pyplot是Matplotlib模塊的基於狀態的接口,該模塊提供了MATLAB-like接口。
matplotlib.pyplot.minorticks_off()函數:
matplotlib庫的pyplot模塊中的minorticks_off()函數用於刪除軸上的較小刻度線。
用法: matplotlib.pyplot.minorticks_off()
參數: This method does not accepts any parameters.
Return value: This method does not returns any value.
注意:如果在使用minorticks_on()函數後使用此函數,它將顯示任何更改或效果。
以下示例說明了matplotlib.pyplot中的matplotlib.pyplot.minorticks_off()函數:
範例1:
# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
plt.minorticks_on()
np.random.seed(19680801)
mu, sigma = 100, 15
x = mu + sigma * np.random.randn(10000)
plt.hist(x, 150, density = True, facecolor ='g', alpha = 0.65)
plt.xlim(40, 160)
plt.ylim(0, 0.03)
plt.grid(True)
plt.minorticks_off()
plt.title('matplotlib.pyplot.minorticks_off() function Example',
fontweight ="bold")
plt.show()
輸出:
範例2:
# Implementation of matplotlib function
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 2, 0.01)
y1 = np.sin(2 * np.pi * x)
y2 = 1.2 * np.sin(4 * np.pi * x)
plt.minorticks_on()
plt.fill_between(x, y1, y2, color ="green", alpha = 0.6)
plt.minorticks_off()
plt.title('matplotlib.pyplot.minorticks_off() function Example',
fontweight ="bold")
plt.show()
輸出:
相關用法
注:本文由純淨天空篩選整理自SHUBHAMSINGH10大神的英文原創作品 matplotlib.pyplot.minorticks_off() in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。