<s> import numpy as np <EOL> from numpy . testing import dec <EOL> from statsmodels . graphics . correlation import plot_corr , plot_corr_grid <EOL> from statsmodels . datasets import randhie <EOL> try : <EOL> import matplotlib . pyplot as plt <EOL> have_matplotlib = True <EOL> except : <EOL> have_matplotlib = False <EOL> @ dec . skipif ( not have_matplotlib ) <EOL> def test_plot_corr ( ) : <EOL> hie_data = randhie . load_pandas ( ) <EOL> corr_matrix = np . corrcoef ( hie_data . data . values . T ) <EOL> fig = plot_corr ( corr_matrix , xnames = hie_data . names ) <EOL> plt . close ( fig ) <EOL> fig = plot_corr ( corr_matrix , xnames = [ ] , ynames = hie_data . names ) <EOL> plt . close ( fig ) <EOL> fig = plot_corr ( corr_matrix , normcolor = True , title = '<STR_LIT>' , cmap = '<STR_LIT>' ) <EOL> plt . close ( fig ) <EOL> @ dec . skipif ( not have_matplotlib ) <EOL> def test_plot_corr_grid ( ) : <EOL> hie_data = randhie . load_pandas ( ) <EOL> corr_matrix = np . corrcoef ( hie_data . data . values . T ) <EOL> fig = plot_corr_grid ( [ corr_matrix ] * <NUM_LIT:2> , xnames = hie_data . names ) <EOL> plt . close ( fig ) <EOL> fig = plot_corr_grid ( [ corr_matrix ] * <NUM_LIT:5> , xnames = [ ] , ynames = hie_data . names ) <EOL> plt . close ( fig ) <EOL> fig = plot_corr_grid ( [ corr_matrix ] * <NUM_LIT:3> , normcolor = True , titles = '<STR_LIT>' , cmap = '<STR_LIT>' ) <EOL> plt . close ( fig ) </s>
