I am trying to plot a logarithmic plot using seaborn factorplot on a dataframe as follows
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
l1 = [0.476, 0.4427, 0.378, 0.2448, 0.13, 0.004, 0.012, 0.0933, 3.704e-05,
1.4762e-06, 4.046e-08, 2.99e-10, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
df = pd.DataFrame(l1, columns=["y"])
df.reset_index(inplace=True)
g = sns.factorplot(x='index',y='y', data=df, aspect=2, size=8)
g.fig.get_axes()[0].set_yscale('log')
plt.grid(True,which="both",ls="--",c='gray')
plt.show()
Even though I changed the Y-axis scale to log and used both the gridlines, the final figure doesnt have the log scale ticks. However, the same code when used with another set of values gives me the following figure. In this case, the minimum value is limited to 10^-7
l2 = [0.29, 0.111, 0.0285, 0.0091, 0.00045, 5.49759e-05, 1.88819e-06, 0.0, 0.0, 0.0]
df = pd.DataFrame(l2, columns=["y"])
# same code as above
Any idea where I am being wrong?
Update 1
I follwed Diziet's answer and forced the major and minor ticks as follows
g.ax.yaxis.set_minor_locator(tkr.LogLocator(base=10, subs='all'))
g.ax.yaxis.set_minor_formatter(tkr.NullFormatter())
g.ax.set_yscale('log')
g.ax.grid(True,which="both",ls="--",c='gray')
But it still doesnt solve the problem