I'm trying to get minor ticks and gridlines plotted in all plots when using lmplot, using the code below:
sns.set(context="notebook", style='white', font_scale=2)
g=sns.lmplot(data=data ,
x="x",
y="y",
col="item", # or use rows to display xplots in rows (one on top of the other)
fit_reg=False,
col_wrap=2,
scatter_kws={'linewidths':1,'edgecolor':'black', 's':100}
)
g.set(xscale='linear', yscale='log', xlim=(0,0.4), ylim=(0.01, 10000))
for ax in g.axes.flatten():
ax.tick_params(axis='y', which='both', direction='out', length=4, left=True)
ax.grid(b=True, which='both', color='gray', linewidth=0.1)
for axis in [ax.yaxis, ax.xaxis]:
formatter = FuncFormatter(lambda y, _: '{:.16g}'.format(y))
axis.set_major_formatter(formatter)
sns.despine()
g.tight_layout()
# Show the results
plt.show()
So far, only major ticks and gridlines are shwon in all plots.
Thanks for any advice for solving this