2017-06-02 24 views
2

私は、x軸ラベルを回転させるようにしようとしていますが、以下のxticks機能は効果がありませんし、ラベルが提案されたコードの変更を使用した後、互いPythonのpyplot x軸ラベルの回転

import matplotlib.pyplot as plt 
import seaborn as sns 
    corrmat = X.corr() 
    plt.xticks(rotation=90)  
    plt.figure(figsize=(15,16))   
    ax = sns.heatmap(corrmat, vmin=0, vmax=1) 
    ax.xaxis.tick_top() 

Jumbled xaxis

を上書き:私は、次のことを得るが、私はまだヒートマップ

How to increase the size of this heatmap

答えて

3

のサイズを大きくしたいですはpyplot(このインスピレーションfrom this answer)と一緒に行く方法に見えます。これは私の作品:

import matplotlib.pyplot as plt 
import seaborn as sns; sns.set() 
import numpy as np; np.random.seed(0) 

data = np.random.rand(10, 12) 
ax = sns.heatmap(data) 
ax.xaxis.tick_top() 
locs, labels = plt.xticks() 
plt.setp(labels, rotation=90) 
plt.show() 

もちろん、私は、あなたのデータを持っていないので、numpyのランダムデータが、必要に応じてそれ以外の効果は次のとおりです。私はあなたのコードで私の質問を更新し

enter image description here

+0

(いくつかの変更を加えて)。このヒートマップのサイズを大きくするにはどうすればよいですか? – User1

+0

新しい質問のように聞こえなくなりました。元の質問に回答した場合は、この回答を受け入れて新しい質問として再送信してください。これは技術サポートディスカッションサイトではなく、Q&Aサイトです。 –

関連する問題