Increase tick label font size in seaborn

后端 未结 3 1855
谎友^
谎友^ 2021-02-05 08:18

I have a huge problem with my seaborn plots. For some reason, the numbers along the axis are printed with a really small font, which makes them unreadable. I\'ve tried to scale

3条回答
  •  心在旅途
    2021-02-05 09:01

    Expanding on the accepted answer, if you want to just rescale the font size of the tick labels without scaling other labels by the same amount, you can try this:

    import pandas as pd, numpy as np, seaborn as sns
    from matplotlib import pyplot as plt
    
    # Generate data
    df = pd.DataFrame({"Draughts": np.random.randn(100)})
    
    # Plot using seaborn
    b = sns.violinplot(y = "Draughts", data = df)
    b.set_yticklabels(b.get_yticks(), size = 15)
    
    plt.show()
    

    Plot link

提交回复
热议问题