2017-02-22 1575 views
2

我的海豹情節有一個很大的問題。出於某種原因,軸上的數字會以非常小的字體打印,這使得它們不可讀。我試圖用它們來縮放它們在seaborn中增加刻度標籤字體大小

with plt.rc_context(dict(sns.axes_style("whitegrid"), 
        **sns.plotting_context(font_scale=5))): 
    b = sns.violinplot(y="Draughts", data=dr) 

沒有任何幫助,這隻會使軸文本變大,而不是沿着軸的數字。 See image

回答

1

here答案使字體在seaborn大...

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 
sns.set(font_scale = 2) 
b = sns.violinplot(y = "Draughts", data = df) 
plt.show() 

enter image description here