Home > Software engineering >  How to set axis label format to scientific format in seaborn relplot with facets when axes are not s
How to set axis label format to scientific format in seaborn relplot with facets when axes are not s

Time:06-07

I am creating a facet plot with the seaborn library with:

titanic = sns.load_dataset('titanic')
g = sns.relplot(data=titanic, x='fare', y='age', col='sex', row='survived', height=2, facet_kws=dict(sharex=False, sharey=False))
g.set_titles(row_template='{row_name}', col_template='{col_name}')
plt.ticklabel_format(axis='both', style='scientific', scilimits=(0, 0))

enter image description here

I would like ALL subplots to have scientific notation.

Using Seaborn version 0.11.2

CodePudding user response:

  • Since the axes are not shared, the format can be set by iterating through each axes.
  • This enter image description here

  • Related