Home > Enterprise >  How to set log scale minor ticks on xaxis for all relplot subplots after using .set
How to set log scale minor ticks on xaxis for all relplot subplots after using .set

Time:06-11

import pandas as pd
import seaborn as sns

tips = sns.load_dataset("tips")
tips['total_bill']=tips.total_bill*10**(tips.index/60 2)

sns.set(font_scale=2)
g=sns.relplot(data=tips,height=5, x="total_bill", y="tip", hue="day", col="time")
g.set(xscale='log')

According to different params (font_scale,height,etc), there might be some minor ticker for each 1/10 or not on the plt. enter image description here

How to make sure all minor tickers for each 1/10 be shown in all subplots?

like this:

enter image description here

CodePudding user response:

  • Similar to this enter image description here

    With sns.set(font_scale=2, style='ticks')

    • See enter image description here

      Without Using .set

      enter image description here

  • Related