0

Could someone help me understand how to manipulate the below code in Python as part of the Dython package to change the x and y label font size on the heat map that this code produces?

import pandas as pd
from dython.nominal import associations

# Download and load data from UCI
df = pd.read_csv('http://archive.ics.uci.edu/ml/machine-learning-databases/mushroom/agaricus-lepiota.data')
df.columns = ['class', 'cap-shape', 'cap-surface', 'cap-color', 'bruises', 'odor', 'gill-attachment',
              'gill-spacing', 'gill-size', 'gill-color', 'stalk-shape', 'stalk-root', 'stalk-surface-above-ring',
              'stalk-surface-below-ring', 'stalk-color-above-ring', 'stalk-color-below-ring', 'veil-type',
              'veil-color', 'ring-number', 'ring-type', 'spore-print-color', 'population', 'habitat']

# Plot features associations
associations(df, theil_u=True, figsize=(15, 15))

Reading the documentation on the below link seems to suggest ax as a parameter on the associations method but I can't figure out how to tweak this

Dython Association Method

Khu
  • 39
  • 7

1 Answers1

0

There's no specific configuration for the font size in this method, but as the heat-map is just another Matplotlib ax, you can change the font size using Matplotlib's methods. See this and this. Note that associations returns the ax as part of its output dict, and you can set plot=False to prevent it from plotting.

shakedzy
  • 2,853
  • 5
  • 32
  • 62