python - How to scale Seaborn's y-axis with a bar plot? -
i'm using factorplot(kind="bar")
.
how scale y-axis, example log-scale?
i tried tinkering plot's axes, messed bar plot in 1 way or another, please try solution first make sure works.
you can use matplotlib commands after calling factorplot
. example:
import seaborn sns import matplotlib.pyplot plt sns.set(style="whitegrid") titanic = sns.load_dataset("titanic") g = sns.factorplot("class", "survived", "sex", data=titanic, kind="bar", size=6, palette="muted", legend=false) g.fig.get_axes()[0].set_yscale('log') plt.show()
Comments
Post a Comment