[英]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.