How to customize a scatter matrix to see all titles?

As a minimal scatter_matrix example to switch off axis ticks and rotate the labels,

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
try:
    from pandas.tools.plotting import scatter_matrix
except ImportError:
    #Fix suggested by @Raimundo Jimenez as tools is deprecated
    from pandas.plotting import scatter_matrix

df = pd.DataFrame(np.random.randn(1000, 4), columns=['long label', 'testing', 'another label', 'something else'])

sm = scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde')

#Change label rotation

#May need to offset label when rotating to prevent overlap of figure

#Hide all ticks

plt.show()

and similarly, you can adjust labels, resize, etc with any of the axis objects contained in the returned handle from scatter_matrix. This results in,

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)