[英]How the number of grid lines can be increased in seaborn?
基於這個問題: 使用 seaborn 向 matplotlib 圖中添加次要網格線,您可以這樣做。
sns.set_style("darkgrid")
fig, ax = plt.subplots(1, 1)
x = np.arange(10)
ax.plot(x, x)
ax.get_xaxis().set_minor_locator(mpl.ticker.AutoMinorLocator())
ax.get_yaxis().set_minor_locator(mpl.ticker.AutoMinorLocator())
ax.grid(b=True, which='major', color='w', linewidth=1.0)
ax.grid(b=True, which='minor', color='w', linewidth=0.5)
你得到這個數字:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.