2015-10-13 13 views
12

सीबर्न हीटमैप का उपयोग करते समय ऑटो आकार फ़ॉन्ट आकार समायोजित करें, क्या वर्गों के अंदर ठीक फिट करने के लिए फ़ॉन्ट आकार को स्वत: समायोजित करने का कोई तरीका है?सीबर्न हीटमैप

यहाँ आकार "annot_kws" में सेट किया गया है: उदाहरण के लिए में ।

+1

वहाँ नहीं है फॉन्ट पैमाने पर करने को दिखाता है; यह भरोसेमंद भविष्यवाणी करने के लिए बहुत सी चीजों पर निर्भर करता है। – mwaskom

+0

धन्यवाद @mwaskom – Gabriel

+7

'annot_kws = {" size ": 8}' के लिए धन्यवाद! ठीक वही जो मेरे द्वारा खोजा जा रहा था :)। – ostrokach

उत्तर

0

हालांकि यह हीटमैप विकृत, इस उदाहरण कैसे .set(...) संदर्भ का उपयोग कर

import matplotlib.pyplot as plt 
import seaborn as sns 
sns.set(font_scale=3) 

# Load the example flights dataset and conver to long-form 
flights_long = sns.load_dataset("flights") 
flights = flights_long.pivot("month", "year", "passengers") 

# Draw a heatmap with the numeric values in each cell 
f, ax = plt.subplots(figsize=(9, 6)) 
sns.heatmap(flights, annot=True, fmt="d", linewidths=.5, ax=ax) 
f.savefig("output.png") 
संबंधित मुद्दे